Hi,

On Sat, Jan 26 2019, Gerald Pfeifer wrote:
> On Sat, 26 Jan 2019, Martin Jambor wrote:
>> I'd like to propose the following hunk mentioning -Wabsolute-value in
>> changes.html of the upcoming gcc 9.  Is it OK?
>
> Lovely^WThanks, ok!
>
> Actually, one question:
>
>> +      <li><code>-Wabsolute-value</code> warns when a wrong absolute value
>> +       function seems to be used or when it does not have any effect because
>> +       its argument is an unsigned type.  The <code>-Wabsolute-value</code>
>> +       option is included in <code>-Wextra</code>.
>
> What is a "wrong absolute value function"?  That might be good to
> show by means of an example?  (Also in invoke.texi, which I checked
> before writing this.)

Most usually wrong means an absolute value function for a shorter type
than the one privided, such as abs when labs would be approproiate, or
abs or labs when you actually need llabs.  Or using normal
floating-point absolute value function such as fabs for
binary-coded-decimal.  Or even for a complex double/float, which
hitherto passed without a warning.

I'm not sure how to change the wording, perhaps "...when a used absolute
value function seems wrong for the type of its argument" ...?

Martin

Reply via email to