- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
The icc version that I use is 'icc (ICC) 14.0.2 20140120' in linux.
Some elements in some structs are declared as deprecated. Some functions will use those deprecated elements.
For example, __attribute__((deprecated)) int *val;
If gcc is used, the following preprocessor lines can turn off and on 'deprecated warning'
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
If icc is used. how to turn off and on 'deprecated warning' in source code, but not in compiling flags.
Thanks!
Regards
Andrew
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use pragma warning with the diagnostic number instead, i.e.:
#pragma warning (disable:1478)
void foo() {
val = 0; // uses deprecated varable
}
#pragma warning (enable:1478)
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your help.
I have another question. Is there some micro definition with which to differentiate between GCC and ICC compiler?
Thanks
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes.
__INTEL_COMPILER
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may want to bookmark https://sourceforge.net/p/predef/wiki/Home/. It's a great resource for answering that type of question (the second one, not the first). Second only to https://graphics.stanford.edu/~seander/bithacks.html on my list of favorite C/C++ resources (though the former is generally slightly more useful).

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