I'm trying to use Visual Studio 2017 Code Analysis to find places where the return values from a function are ignored.
I'm trying to avoid using the SAL annotation: _Check_return_. It makes the code less readable and requires a lot of effort to add it to all the functions.
_Check_return_ int foo(_In_ int x){return x + 1;}
void goo(){foo(5);}
This will produce a warning:
Warning C6031 Return value ignored: 'foo'
Is there a simple way to get the same result without explicitly demanding it?