bug-gnulib
[Top][All Lists]
Advanced

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

Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-


From: Paul Eggert
Subject: Re: Removing -Wunsuffixed-float-constants, -Wdouble-promotion, -Wformat-zero-length
Date: Tue, 29 Nov 2011 13:45:18 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0

On 11/29/11 13:19, Eric Blake wrote:

> hard to disable the warning if you don't want it, but leaving it in
> leads to smaller executable size for the cases where 1.0F is sufficient
> (compared to the extra size required to represent 1.0 which is 1.0D).

1.0D?  But the C standard doesn't allow that.  Surely such a constant
can't be used in portable code.  So I don't see how the warning can
be useful in practice.

>> While we're on the subject of manywarnings.m4, can we also
>> remove -Wdouble-promotion and -Wformat-zero-length?  They
>> also seem to be more suited for special- rather than
>> general-purpose code.
> 
> Do you have instances in the wild where these triggered?

No, it's just my instinct -- I gave an example for -Wformat-zero-length
in my earlier email, and my instinct also is that widening float to
double is no more problematic than widening int to long (which I
surely don't want a warning for).

> I had to add -Wno-format-nonliteral to counteract that, while still
> benefitting from the rest of -Wformat=2.

I'd be in favor of that as well.  format-nonliteral is a warning that
typically causes more harm than it cures, in my experience.



reply via email to

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