Warning C6505
Invalid annotation: MustCheck property may not be used on values of void type
Remarks
This warning indicated that MustCheck property was used on a void data type. You can't use MustCheck
property on void
type. Either remove the MustCheck
property or use another data type.
Code analysis name: MUSTCHECK_ON_VOID
Example
The following code generates this warning:
#include <sal.h>
_Must_inspect_result_ void f()
{
//Code ...
}
To correct this warning, use the following code:
#include <sal.h>
_Must_inspect_result_ char* f()
{
char *str ="Hello World";
//Code ...
return str;
}
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for