- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Compiling using Parallel Studio 2017 on Windows 10, VS 2015 community edition
#ifdef WIN32
#pragma warning( push, 46 )
#pragma warning( disable: 46 )
#define _Pragma(text) __pragma(text) // ignore this warning message
#pragma warning( pop )
#endif
1>..\..\src\./checker.h(294): warning #46: "_Pragma" is predefined; attempted redefinition ignored
1> #define _Pragma(text) __pragma(text)
1> ^
Why did the warning #46 not get suppressed?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the Intel Compiler #pragma warning is implemented so it is applied at the point of the next statement or declaration. In your example there is no such declaration or statement until after the diagnostic is generated.
To workaround the problem you can add a dummy declaration after the #pragma warning like so:
#pragma warning( push, 46 )
#pragma warning( disable: 46 )
int dummy();
#define _Pragma(text) __pragma(text) // ignore this warning message
#pragma warning( pop )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I assume this is seen as a bug and is going to get fixed!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page