- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm new to the Intel compiler having previously used Visual Studio C++ compiler. With VS we would use a #pragma to disable various warnings just before including third party headers but then re-enable them after inclusion (there's no way we can fix those warnings and we don't want our output flooded with things we can't change as it makes it harder to see things we are doing wrong ourselves).
I'm looking for a similar way to temporarily disable remarks/warnings/numbered messages around header includes, but leave them enabled for our own code so we can avoid making those mistakes? I've only seen compiler options that disable them for the entire compilation unit.
We find this genuinely useful but if it's not considered good practise I'm happy to hear why.
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use #pragma warning push/pop to surround the #include to suppress most warnings. There are some warnings that can't be suppressed this way due to compiler scope issues.
#pragma warning push
#pragma warning disable M N P ... // M N P are the warning numbers that you want to suppress
#include <file>
#pragma warning pop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, thanks, that's similar to VS. Can we do the same with numbered Remark and Message outputs? Again they're probably useful for our code but not for included libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes it should work for Remarks too.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page