Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 1.27 KB

compiler-warning-level-4-c4985.md

File metadata and controls

25 lines (17 loc) · 1.27 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Warning (level 4) C4985
Compiler Warning (level 4) C4985
11/04/2016
C4985
C4985
832f001c-afe7-403d-a8b4-02334724c79e

Compiler Warning (level 4) C4985

'symbol-name': attributes not present on previous declaration.

The Microsoft source code annotation language (SAL) annotations on the current method declaration or definition differ from the annotations on an earlier declaration. The same SAL annotations must be used in the definition and declarations of a method.

The SAL provides a set of annotations that you can use to describe how a function uses its parameters, the assumptions it makes about them, and the guarantees it makes on finishing. The annotations are defined in the sal.h header file.

Notice that the SAL macros will not expand unless the project has the /analyze flag specified. When you specify /analyze, the compiler can throw C4985, even if no warnings or errors appeared without /analyze.

To correct this error

  1. Use the same SAL annotations on the definition of a method and all its declarations.

See also

SAL Annotations