Mittwoch, 7. September 2011 15:29
Visual Studio 2008 9.0.30729.1 SP
.NET Framework 3.5 SP1
The Prefast option resolves to the following call:
Prefast /list /filter “/FilterPreset=(all defects)” build.exe -cZ
Unreachable code and use of NULL pointers are reported so Prefast is running, but incorrect use of SALs are not reported.
We are using the "__in" variety. I guess I'm missing something fairly fundamental.
Donnerstag, 8. September 2011 08:06Moderator
Donnerstag, 8. September 2011 08:36
There are no warnings for:
void OverwriteIt (__in_bcount (length) char* buffer, __in size_t length)
buffer [length+2] = 0;
buffer  = 0;
There is an "inconsistent use" warning for:
void OverwriteIt (__in_bcount (foo) char* buffer, __in size_t length)
Montag, 3. Dezember 2012 10:28
are you guys going to fix this? When I have seen this I did not believe my eyes, copy-pasted the snippet to VS 2012, and you know what -- no analyzer warnings!!!
this doesn't cause any warnings either
void OverwriteIt (_Out_cap_(length) char* buffer, size_t length)
memset(buffer, 0, length + 2);