Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

How do I unsuppress warnings in system include files?

pete_a90
Beginner
520 Views
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?
0 Kudos
2 Replies
cp_jain
Beginner
520 Views
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 < asdf.h >

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.
0 Kudos
Maximillia_D_Intel
520 Views

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

0 Kudos
Reply