This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -Werror now enabled by default


On Wed, 10 Dec 2014, Adhemerval Zanella wrote:

> Something like that:
> 
> diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
> index 1961355..641cfd6 100644
> --- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
> +++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
> @@ -70,12 +70,16 @@
> 
>  #include <math.h>
>  #include <math_private.h>
> +#include <libc-internal.h>
> 
> +DIAG_PUSH_NEEDS_COMMENT;
> +DIAG_IGNORE_NEEDS_COMMENT (4.6, "-Woverflow");

Well, *with the comment* explaining the warning and referring to the 
existing open bug for it.  Never add diagnostic suppression macros without 
appropriate comments explaining the suppression.

> I still trying to figure out why the test for MAXLGM is necessary (it 
> seems redundant to me, since for overflow it will be generate by the log 
> call itself).  Anyway, I know this is not the perfect solution, but I 

In some rounding modes, without the MAXLGM test you'd get LDBL_MAX 
(finite) as the overflowed result from (x - 0.5L) * __logl (x), and then 
adding (negative) q (== ls2pi - x) would result in a return other than 
LDBL_MAX, which would not be correct for overflow.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]