Поделиться через


C6517

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 C6517: Invalid annotation: 'SAL_readableTo' property may not be specified on buffers that are not readable: 'Param\(1)'.

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.

This warning indicates that SAL_readableTo property does not have the required read access. You cannot use this property to annotate a parameter without providing read access.

Example

The following code generates this warning because read access is not 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

Annotation Properties