Skip to content

Commit 9c8b0c2

Browse files
pmisikdanmar
authored andcommitted
Workaround for syntax error on Microsoft specific __pragma keyword (danmar#982)
__pragma is Microsoft specific keyword equivalent to C99 _Pragma operator https://msdn.microsoft.com/en-us/library/d9x1s805.aspx https://gcc.gnu.org/onlinedocs/cpp/Pragmas.html http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas It seems cppcheck does not support _Pragma at the moment. This change will fix syntax error on code that looks like this: #define MY_DEPRECATED_ENUM(X) X __pragma(deprecated(X)) enum myEnum { myEnum_1 = 1, MY_DEPRECATED_ENUM(myEnum_2) = 2, myEnum_3, myEnum_4, }; int main() { myEnum a = myEnum_3; printf("%d", a); return 0; } This change was fiscussed here: https://sourceforge.net/p/cppcheck/discussion/general/thread/1808a46b/
1 parent 2b717c6 commit 9c8b0c2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cfg/windows.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3620,4 +3620,5 @@ HFONT CreateFont(
36203620
<define name="INVALID_HANDLE_VALUE" value="0"/>
36213621
<define name="INVALID_SOCKET" value="0"/>
36223622
<define name="WINAPI" value=""/>
3623+
<define name="__pragma(x)" value=""/>
36233624
</def>

0 commit comments

Comments
 (0)