- To: noloader@xxxxxxxxx
- Subject: Re: GCC warning options for numerical programs
- From: Andrew Haley <aph@xxxxxxxxxx>
- Date: Mon, 23 Apr 2012 15:01:33 +0100
- Cc: gcc-help@xxxxxxxxxxx
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- In-reply-to: <CAH8yC8=61sZjVp=ZpqXxLeaiqXF8SJpsw2UzDGAP3ehoHmWaHQ@mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1
On 04/23/2012 02:52 PM, Jeffrey Walton wrote:
> On Mon, Apr 23, 2012 at 9:45 AM, Andrew Haley <aph@xxxxxxxxxx> wrote:
>> On 04/23/2012 02:37 PM, Jeffrey Walton wrote:
>>> If you don't want to know about potential problems, you don't have to
>>> use -Weverything (or -Wall -Wextra). Folks who are interested in all
>>> potential problems could use it (if available).
>>
>> I don't think so, given the variety of odd style warnings.
>>
>> I'm not even sure that the warnings are compatible with each other!
>> Anyone who just turns on *everything* is probably either doing so
>> because they're clueless because or a pointy-haired boss said "no
>> warnings."
> I fall into the later (but I'm not a boss). A clean compile is a security gate.
But a clean compile with no GCC warnings is not a security gate.
> When I start seeing problems with, for example, -Wconversion, I start
> questioning the lack of attention to detail and wonder if I'm dealing
> with a lazy or sloppy programmer or someone who has thought each
> warning through. I then write a negative test case and usually find
> its a sloppy programmer.
Yes. Some warnings are important, and some aren't. You have to be
discriminating or you mess up your program.
Consider, for instance, -Wdouble-promotion. If you're working on an
embedded system you might want this; if you're working on a desktop
system you probably don't. And do you want -Wtraditional ? I doubt
it.
Andrew.
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]