In the long run it would be nice to handle such annotations in Cppcheck so we can write warnings if myEnum_2 is used. Adding support for microsoft SAL is on my wish list.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Following code reports syntax error:
hmm.. is
__pragma
some visual studio macro? or is it a windows sdk macro. I think it should be defined in some cfg file.__pragma – is actually Microsoft specific keyword equivalent to C99 _Pragma operator
https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html
http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas
https://msdn.microsoft.com/en-us/library/d9x1s805.aspx
It seems cppcheck does not support _Pragma at the moment.
Defining __pragma(x) solves problem.
My proposal is to add definition of this macro to windows.cfg
<define name="__pragma(x)" value=""/>
Last edit: pmisik 2017-10-20
I agree.. could you perhaps send me a github pull request and I will apply that?
Send the pull request for this repo:
http://github.com/danmar/cppcheck
Last edit: Daniel Marjamäki 2017-10-20
In the long run it would be nice to handle such annotations in Cppcheck so we can write warnings if myEnum_2 is used. Adding support for microsoft SAL is on my wish list.
https://github.com/danmar/cppcheck/pull/982