From 9124ccf76abc5a2ffe4603e6424b1dc2b5a5db44 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 21 May 2015 23:44:33 +0000 Subject: Fix lgamma implementations for -Wuninitialized. If you remove the "override CFLAGS += -Wno-uninitialized" in math/Makefile, you get errors from lgamma implementations of the form: ../sysdeps/ieee754/dbl-64/e_lgamma_r.c: In function '__ieee754_lgamma_r': ../sysdeps/ieee754/dbl-64/e_lgamma_r.c:297:13: error: 'nadj' may be used uninitialized in this function [-Werror=maybe-uninitialized] if(hx<0) r = nadj - r; This is one of the standard kinds of false positive uninitialized warnings: nadj is set under a certain condition, and then later used under the same condition. This patch uses DIAG_* macros to suppress the warning on the use of nadj. The ldbl-128 / ldbl-128ibm implementation has a substantially different structure that avoids this issue. Tested for x86_64. (In fact this patch eliminates the need for that -Wno-uninitialized on x86_64, but I want to test on more architectures before removing it.) * sysdeps/ieee754/dbl-64/e_lgamma_r.c: Include . (__ieee754_lgamma_r): Ignore uninitialized warnings around use of NADJ. * sysdeps/ieee754/flt-32/e_lgammaf_r.c: Include . (__ieee754_lgammaf_r): Ignore uninitialized warnings around use of NADJ. * sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Include . (__ieee754_lgammal_r): Ignore uninitialized warnings around use of NADJ. --- ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index bca6ba7a3f..ba7a400e53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2015-05-21 Joseph Myers + * sysdeps/ieee754/dbl-64/e_lgamma_r.c: Include . + (__ieee754_lgamma_r): Ignore uninitialized warnings around use of + NADJ. + * sysdeps/ieee754/flt-32/e_lgammaf_r.c: Include . + (__ieee754_lgammaf_r): Ignore uninitialized warnings around use of + NADJ. + * sysdeps/ieee754/ldbl-96/e_lgammal_r.c: Include . + (__ieee754_lgammal_r): Ignore uninitialized warnings around use of + NADJ. + * sysdeps/ieee754/dbl-64/mpa.c (norm): Remove if condition on (p == 4) case. -- cgit 1.4.1