General
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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.