Warning C6517

Invalid annotation: 'SAL_readableTo' property may not be specified on buffers that are not readable: 'Parameter'.

Note

This warning occurs only in code that is using a deprecated version of the source-code annotation language (SAL). We recommend that you port your code to use the latest version of SAL. For more information, see Using SAL Annotations to Reduce C/C++ Code Defects.

Remarks

This warning indicates that SAL_readableTo property doesn't have the required read access. You can't use this property to annotate a parameter without providing read access.

Code analysis name: VALID_SIZE_ON_NON_READABLE_BUFFER

Example

The following code generates this warning because read access isn't granted on the buffer:

#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f([Pre( ValidBytesConst=10 )][Pre( Deref=1, Access=Write )] char* buffer );

To correct this warning, grant read access as shown in the following code:

#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
void f([Pre( ValidBytesConst=10 )][Pre( Deref=1, Access=Read)] char* buffer );

See also

Using SAL Annotations to reduce code defects