help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with disabling warnings


From: John Qyindi
Subject: Re: help with disabling warnings
Date: 17 Aug 2004 14:29:55 -0700

The compilers are different and the other developer is not compiling
with the -Wall argument... I think maybe the disable_warn pragma is
from an earlier version of the compiler.  Anyhow most of the warnings
come from the following type of code:

for( int i = 0; i < vec.size(); ++i )

it is complaining about comparing int to unsigned int.




Guy Harrison <swamp-DEL-dog@ntlworld.com> wrote in message 
news:<vgdrfc.dqg1.ln@sd-if.swampdog>...
> John Qyindi wrote:
> 
> > Hi,
> > 
> > I'm trying to get some code up and running that another developer sent
> > but am getting many warnings when compiling it.  I don't want to
> > change the code as I don't want to introduce any differences from his
> > original code.
> 
> Are you using an identical compiler version? If not, then you'll have
> trouble distinguishing between which warnings would have occurred anyway
> (code needs fixing), and which warning have occurred because of differences
> in compiler versions (code likely wants upgrading).
> 
> > So I tried the #pragma disable_warn in the code for now but g++ then
> > says
> > 
> > warning: ignoring pragma disable_warn
> 
> Can't find that in my manual. Odd because it rings a bell. Maybe its off
> another platform?
> 
> In any case, use of #pragma in gcc is not encouraged. You might use it in
> headers or platform specific code but elsewhere not a good idea.
> 
> > is this pragma not compatible with the -Wall argument ?
> 
> I believe "Wall" does have an affect of treatment of pragmas but not in a
> way as most of us need to care. The solution is as mentioned in 1st
> paragraph. Note also that g++ conformance to standard is improving. It's
> becoming more fussy over backwards compatibility (less permitting thereof).
> Warnings related to those kinds of issue have an unwritten timestamp which
> says "I'm warning now, soon I'm not going to work at all".
> 
> By far the best approach is to contact the developer and between you bring
> the code up to date. You'll both benefit. ;-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]