slyi
January 6, 2007, 12:57am
1
Hi,
Well, I do not want to turn off ALL warnings. I want to turn off those that I do not want to see.
For instance, for the following (perfectly valid) statement:
assert( one == 1 && "One is not 1");
pgCC generates:
warning: controlling expression is constant
Is there any way I can turn this off?
thanks
Hi slyi,
You can do this with the “–diag_suppress” flag.
% cat warn.cpp
void foo () {
if("One is not 1");
}
% pgcpp --display_error_number -c warn.cpp
"warn.cpp", line 2: warning #236-D: controlling expression is constant
if("One is not 1");
^
% pgcpp --diag_suppress 236 -c warn.cpp
Also, the pragma “#pragma diag_suppress 236” will work as well.
%cat warn.cpp
void foo () {
#pragma diag_suppress 236
if("One is not 1");
}
% pgcpp -c warn.cpp
%