help-gplusplus
[Top][All Lists]
Advanced

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

Re: help with disabling warnings


From: Guy Harrison
Subject: Re: help with disabling warnings
Date: Tue, 17 Aug 2004 00:00:24 GMT
User-agent: KNode/0.7.7

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]