Udostępnij za pośrednictwem


C28250

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

warning C28250: Inconsistent annotation for function: the prior instance has an error.

Note: There are several prototypes for this function. This warning compares the first prototype with instance number <number>.

If a declaration is made using a typedef, the line where the typedef appears is more useful than the line of the declaration.

This warning refers to an error in the annotation and reflects the requirement that the annotations on a function declaration must match those on the definition, except if a function typedef is involved. In that case, the function typedef is taken as definitive for both the declaration and the definition.

Note that annotations are usually implemented as macros, and one macro will usually yield several low-level annotations. This warning is reported for each unmatched low-level annotation, so a single unmatched annotation macro may yield a number of unmatched low-level annotations. It is best to simply compare the declaration and definition source code to make sure that they are the same. (Trivial differences in the order of the annotations are not reported.)

The comparison is always between the first declaration found and the current one. If there are additional declarations, each declaration is checked pairwise. It is currently not possible to do a comparison other than in pairs, although it is possible to identify that there are more than two declarations/definitions. The text field above contains a list of the annotations that differ (at a fairly low level) between the two instances.

This warning message displays the text of the underlying code sent to the compiler, and not the macros that are used to actually insert the annotation in the source code (as is the case whenever macros are used). In general, you do not need to understand the low-level annotations, but you should recognize that the annotations are being reported as inconsistent between the line numbers reported in the error message. Mostly, an inspection of the source code will make it clear why the inconsistency exists.