How do I unsuppress warnings in system include files?

How do I unsuppress warnings in system include files?

pete_a90's picture

It seems that intel's compiler is treating EDG's --include_directory option as --sys_include with the side-effect that it suppresses warning messages.

Try this experiment:

// asdf.h
char * foo() { 10; }

//a.cpp
#include

icl "-I." a.cpp

No warnings. You can even change that option to "-Qoption,cpp,--include_directory=." and you will still see no warning messages.

Then go change a.cpp to #include "asdf.h" instead and you'll see:

asdf.h(1): warning #1011: missing return statement at end of non-void function "foo"
char * foo() { 10; }

Is there anyway to disable this behavior?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
cp_jain's picture

What I found is - if you generate a preproccessed file and then compile it, compiler generates warning in both the cases.

$ cat a.cpp
#include &lt asdf.h &gt

icpc -E "-I." a.cpp > a.i

icpc -c a.i

./asdf.h(2): warning #1011: missing return statement at end of non-void function "foo"
char * foo() { 10; }

CP
I am not aware of any option that unsuppress warnings in system include files.

maximillian-domeika (Intel)'s picture

Dear Pete,


I think you have the makings of a bug report/feature request. Can you submit the issue through Premier support? It would be good to include why you specifically need this ability.


As an aside, if you add -we1011 (Linux) you will seean error, but of course you want warnings and you want every warning flagged. Interestingly, -ww1011 results in no warning. On Windows, I think the equivalent command is -Qwe1011 and -Qww1011 respectively (don't have a Windows compiler to verify).


Regards,


Max


Login to leave a comment.