Partilhar via


C6518

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 C6518: Invalid annotation: 'SAL_writableTo' property may not be specified as a precondition on buffers that are not writable: 'Param\(1)'

This warning indicates that a conflict exists between a SAL_writableTo property value and a writable property. This ordinarily indicates that a writable property does not have write access to the parameter being annotated.

Example

The following code generates this warning because the _Out_ annotation compiles to include a SAL_writableTo property, which does not allow write access:

#include <sal.h>  
void f(_Out_ const char* pc)  
{  
    //code that can't write to *pc ...  
}  

To correct this warning, use the following code:

#include <sal.h>  
void f(_Out_  char* pc)  
{  
    pc = "Hello World";  
    //code ...  
}