Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

C6505

warning C6505: invalid annotation: MustCheck property may not be used on values of void type

This warning indicated that MustCheck property was used on a void data type. You cannot use MustCheck property on void type. Either remove the MustCheck property or use another data type.

Example

The following code generates this warning:

// C
#include <CodeAnalysis\SourceAnnotations.h>
[returnvalue:SA_Post(MustCheck=SA_Yes)] void f();

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

[returnvalue:Post(MustCheck=Yes)] void f();

To correct this warning, use the following code:

// C
#include <CodeAnalysis\SourceAnnotations.h>
[returnvalue:SA_Post(MustCheck=SA_Yes)] char* f();

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

[returnvalue:Post(MustCheck=Yes)] char* f();

See Also

Reference

C6516

Community Additions

ADD
Show:
© 2015 Microsoft