Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code analysis says Inconsistent annotation for 'wWinMain' : this instance has no annotations

I'm writing some simple win32 stuff and I'm using the following wWinMain

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,                     PWSTR pCmdLine, int nCmdShow) 

VS2012 express code analysis says

C28251 Inconsistent annotation for function: this instance has an error Inconsistent annotation for 'wWinMain': this instance has no annotations. See c:\program files (x86)\windows kits\8.0\include\um\winbase.h(2201). LeesSpaceShip main.cpp 6

I'm not clear on what an annotation even is. So what is an annotation and which part is wrong on my code?

Apart from this diagnostic the code compiles and runs just fine.

like image 923
EddieV223 Avatar asked Oct 25 '12 23:10

EddieV223


1 Answers

The declaration of wWinMain in winbase.h (mentioned in the error) is:

wWinMain(     _In_ HINSTANCE hInstance,     _In_opt_ HINSTANCE hPrevInstance,     _In_ LPWSTR lpCmdLine,     _In_ int nShowCmd     ); 

Your implementation of wWinMain in main.cpp is missing the SAL annotations and Code Analysis is warning you about the mismatch.

like image 195
James McNellis Avatar answered Oct 01 '22 02:10

James McNellis