Edit

Share via


Warning C28253

Inconsistent annotation for function: parameter has another annotations on this instance

This warning refers to an error in the annotation and reflects the requirement that the annotations on a function declaration must match the ones 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.

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 many unmatched low-level annotations. It's best to compare the declaration and definition source code to make sure that they're the same. (Trivial differences in the order of the annotations aren't reported.)

The comparison is always between the first declaration found and the current one. If there are more declarations, then each declaration is checked in groups of two. It's currently not possible to do a comparison other than in pairs, although it's possible to identify that there are more than two declarations/definitions. The error message 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 don't 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.