Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

C6503

warning C6503: Invalid annotation: references and arrays may not be marked Null=Yes or Null=Maybe

Note 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 Null property is incorrectly used on a reference or array type. A reference or array type holds the address of an object and must point to a valid object. Because reference and array types cannot be null, you must correct the error by either removing the Null property or by setting the Null property value to No.

The following code generates this warning:

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
class Point
{
public:
    //  members
};

void f([Pre(Null=Yes)] Point& pt);

To correct this warning, set the Null property to No as shown in the following code:

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;

class Point
{
public:
    //  members
}; 
void f([Pre(Null=No)] Point& pt);
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft