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

warning #279: controlling expression is constant (still)

amaigil
Beginner
1,262 Views
Since I did not manage to reply to the previous thread dealing with it (http://software.intel.com/en-us/forums/showthread.php?t=62941) I open a new one.

That piece of code:
#include
extern bool MaybeOrNot();
void foo()
{
assert(MaybeOrNot() && "That is strange");
}


shows the surprising warning:
icc -c warning279.cpp
warning279.cpp(5): warning #279: controlling expression is constant
assert(MaybeOrNot() && "That is strange");
^

with an icc 11.1 20101201 (on linux).
I appreciate that warning in general, but here I dislike it.

I also find http://software.intel.com/en-us/articles/cdiag279/ and other people on other websites complaining about the surprising message, so I'd like to have this behaviour changed.

Regards
Alexander
0 Kudos
1 Reply
Om_S_Intel
Employee
1,262 Views
You may use -wd279 compiler option to disable the warning.
0 Kudos
Reply