Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

C6518

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.

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 ...
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.