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

MustCheck

The MustCheck property specifies whether the caller must inspect the return value of a function. This property is used as a post condition on the return value of a function.

The MustCheck property must be set by using one of the following values:

  • SA_Yes - the return value must be checked; otherwise warning 6031 is issued.

  • SA_No - the return value should not be checked.

NoteNote

The SA_ prefix is optional for C++.

Checking a return value of a function marked with SA_No does not generate a warning.

The following code shows how to use the MustCheck property:

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

// C++
#include <CodeAnalysis\SourceAnnotations.h>
using namespace vc_attributes;
[returnvalue:Post(MustCheck=Yes)] int f();
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.