Community
cancel
Showing results for 
Search instead for 
Did you mean: 
applemax82
Beginner
671 Views

how to ignore deprecated warning

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

 

 

0 Kudos
4 Replies
Judith_W_Intel
Employee
671 Views

 

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

applemax82
Beginner
671 Views

Thanks for your help.

I have another question. Is there some micro definition with which to differentiate between GCC and ICC compiler?

Thanks

Andrew

Judith_W_Intel
Employee
671 Views

 

Yes.

__INTEL_COMPILER

Judy

nemequ
New Contributor I
671 Views

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).

Reply