- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
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?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
$ 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page