This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: -Werror now enabled by default
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Wed, 10 Dec 2014 18:37:03 +0000
- Subject: Re: -Werror now enabled by default
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 2 dot 10 dot 1412100115170 dot 18857 at digraph dot polyomino dot org dot uk> <mvm4mt3x5vu dot fsf at hawking dot suse dot de> <alpine dot DEB dot 2 dot 10 dot 1412101250150 dot 19440 at digraph dot polyomino dot org dot uk> <mvmr3w7sd38 dot fsf at hawking dot suse dot de> <alpine dot DEB dot 2 dot 10 dot 1412101615130 dot 32166 at digraph dot polyomino dot org dot uk> <mvmmw6vscke dot fsf at hawking dot suse dot de> <alpine dot DEB dot 2 dot 10 dot 1412101623130 dot 32166 at digraph dot polyomino dot org dot uk> <54889123 dot 2030608 at linux dot vnet dot ibm dot com>
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