Operating System - HP-UX
1752727 Members
5698 Online
108789 Solutions
New Discussion юеВ

Re: aCC Compiler. can i ignore some warning codes?

 
Donatoll
Occasional Contributor

aCC Compiler. can i ignore some warning codes?

Hi people!

Machine: HP-UX B.11.23 U ia64
aCC: HP C/aC++ B3910B A.06.20 [May 13 2008]
I'm compiling old source code... It has some horrible things...
Well, sometimes those programs has something like this:
------------------------------------------------------------------------------------------
int function()
{
/* Previous code, not important */
for(;;) /* A FOREVER loop */
{
/* anything */
if (/*anything*/)
break;
if (/*anything*/)
continue;
}
return 0;
}
------------------------------------------------------------------------------------------
Well, it's horrible, but it works. I can't change it (well, i don't want to change all those FOREVER loops).
When i compile those sources, aCC tells me:
------------------------------------------------------------------------------------------
Warning 2111-D: statement is unreachable
return 0;
------------------------------------------------------------------------------------------
I guess that the compiler detects the FOREVER loop and thinks it never ends.
My question is:
Is there anyway to ignore this Warning code?
Well, i could send compiler results to a text file, and then filter the text file ignoring the lines with this code... but i prefer, if possible, to omit this code (only this code).

Thanks in advance!!
3 REPLIES 3
Donatoll
Occasional Contributor

Re: aCC Compiler. can i ignore some warning codes?

Ooops!!!
Forget this thread!!

It's too easy: "aCC +W2111 source.c"

Thanks!!

Donatoll
Occasional Contributor

Re: aCC Compiler. can i ignore some warning codes?

Thread closed!
Dennis Handly
Acclaimed Contributor

Re: aCC Compiler. can i ignore some warning codes?

>Warning 2111-D: statement is unreachable

The compiler seems broken if the presence of the "if (...) break" doesn't suppress the warning.