[COMMITTED] Fix GCC6 build errors due to unused statics

Message ID 002501d0f24b$8fc25110$af46f330$@com
State Committed
Headers

Commit Message

Wilco Dijkstra Sept. 18, 2015, 7:52 p.m. UTC
  Fix several build failures with GCC6 due to unused static variables.

Committed as trivial patch (94afa0a..6565fcb).

ChangeLog:
2015-09-18  Wilco Dijkstra  <wdijkstr@arm.com>

	* resolv/base64.c (rcsid): Remove unused static.	
	* sysdeps/ieee754/dbl-64/atnat2.h (qpi1): Remove unused
	static.  (tqpi1): Likewise.
	* sysdeps/ieee754/dbl-64/uexp.h (one): Likewise.
	* sysdeps/ieee754/dbl-64/upow.h (sqrt_2): Likewise.
	* sysdeps/ieee754/flt-32/e_log10f.c (one): Likewise.
	* sysdeps/ieee754/flt-32/s_cosf.c (one): Likewise.
	* sysdeps/ieee754/ldbl-128/e_lgammal_r.c (zero): Likewise.
	* sysdeps/ieee754/ldbl-128/s_erfl.c (half): Likewise.
	* sysdeps/ieee754/ldbl-128/s_log1pl.c (maxlog): Likewise.
	* timezone/private.h (time_t_min): Likewise.  (time_t_max):
	Likewise.

---
 resolv/base64.c                        |  4 ----
 sysdeps/ieee754/dbl-64/atnat2.h        |  4 ----
 sysdeps/ieee754/dbl-64/uexp.h          |  2 +-
 sysdeps/ieee754/dbl-64/upow.h          |  2 --
 sysdeps/ieee754/flt-32/e_log10f.c      |  2 --
 sysdeps/ieee754/flt-32/s_cosf.c        |  2 --
 sysdeps/ieee754/ldbl-128/e_lgammal_r.c |  1 -
 sysdeps/ieee754/ldbl-128/s_erfl.c      |  1 -
 sysdeps/ieee754/ldbl-128/s_log1pl.c    |  1 -
 timezone/private.h                     | 10 ----------
 10 files changed, 1 insertion(+), 28 deletions(-)
  

Comments

Joseph Myers Sept. 18, 2015, 7:57 p.m. UTC | #1
On Fri, 18 Sep 2015, Wilco Dijkstra wrote:

> 	* timezone/private.h (time_t_min): Likewise.  (time_t_max):
> 	Likewise.

The timezone/ code is imported verbatim from upstream tzcode releases and 
should not be changed locally.  Please revert this change and work with 
Paul on getting a fix into upstream tzcode.  When there's a new tzcode 
release, you can then import it into glibc.  (Some Makefile changes will 
be needed as part of the import of new code; see 
<https://sourceware.org/ml/libc-alpha/2015-05/msg00553.html>.  Do not try 
to combine this with importing a new version of tzdata.)
  
Wilco Dijkstra Sept. 18, 2015, 8:03 p.m. UTC | #2
> Joseph Myers wrote:
> On Fri, 18 Sep 2015, Wilco Dijkstra wrote:
> 
> > 	* timezone/private.h (time_t_min): Likewise.  (time_t_max):
> > 	Likewise.
> 
> The timezone/ code is imported verbatim from upstream tzcode releases and
> should not be changed locally.  Please revert this change and work with
> Paul on getting a fix into upstream tzcode.  When there's a new tzcode
> release, you can then import it into glibc.  (Some Makefile changes will
> be needed as part of the import of new code; see
> <https://sourceware.org/ml/libc-alpha/2015-05/msg00553.html>.  Do not try
> to combine this with importing a new version of tzdata.)

Would it be OK to change the Makefile instead to ignore this error?

Wilco
  
Joseph Myers Sept. 18, 2015, 8:10 p.m. UTC | #3
On Fri, 18 Sep 2015, Wilco Dijkstra wrote:

> > Joseph Myers wrote:
> > On Fri, 18 Sep 2015, Wilco Dijkstra wrote:
> > 
> > > 	* timezone/private.h (time_t_min): Likewise.  (time_t_max):
> > > 	Likewise.
> > 
> > The timezone/ code is imported verbatim from upstream tzcode releases and
> > should not be changed locally.  Please revert this change and work with
> > Paul on getting a fix into upstream tzcode.  When there's a new tzcode
> > release, you can then import it into glibc.  (Some Makefile changes will
> > be needed as part of the import of new code; see
> > <https://sourceware.org/ml/libc-alpha/2015-05/msg00553.html>.  Do not try
> > to combine this with importing a new version of tzdata.)
> 
> Would it be OK to change the Makefile instead to ignore this error?

That (specific to the timezone/ directory, of course) would be a 
reasonable temporary fix until a new tzcode release is out, if it takes a 
while to get a fixed release out.

In general: when you see a build failure resulting from a new GCC warning, 
the first reaction should *not* be to check in a glibc change as fast as 
possible.  First, you should consider whether the warning is in fact 
desirable for glibc - and whether it belongs in -Wall / enabled-by-default 
warnings at all, or whether the warnings seen building glibc are typical 
of widespread usage and provide evidence that the coding style constraint 
implied is inappropriate for -Wall.  Then provide the evidence in the 
gcc-patches discussion, and engage with the discussion there to help reach 
a conclusion on the appropriateness of the warning.

In this case, (a) the gcc-patches discussion has people saying they think 
inclusion in -Wall is a bad idea, and (b) I specifically said in that 
discussion not to change timezone/private.h locally in glibc 
<https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01127.html>.

Now, removing unused variables seems a reasonable cleanup in glibc, 
independent of the warning's inclusion in -Wall - *provided* that all the 
other constraints regarding generated files, files imported from other 
sources etc. are met.  But in general for new warnings fixing them in 
glibc may not be the right thing at all, if it seems plausible the warning 
might be removed from -Wall, and so you need to wait for the gcc-patches 
discussion to reach consensus before making changes that can't be 
justified independently of the warning.
  

Patch

diff --git a/resolv/base64.c b/resolv/base64.c
index ea584ed..519e5d2 100644
--- a/resolv/base64.c
+++ b/resolv/base64.c
@@ -40,10 +40,6 @@ 
  * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
  */
 
-#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "$BINDId: base64.c,v 8.7 1999/10/13 16:39:33 vixie Exp $";
-#endif /* not lint */
-
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/socket.h>
diff --git a/sysdeps/ieee754/dbl-64/atnat2.h b/sysdeps/ieee754/dbl-64/atnat2.h
index e0d65af..82943f9 100644
--- a/sysdeps/ieee754/dbl-64/atnat2.h
+++ b/sysdeps/ieee754/dbl-64/atnat2.h
@@ -65,10 +65,8 @@ 
 /**/ hpi1           = {{0x3c91a626, 0x33145c07} }, /*  pi/2-hpi     */
 /**/ mhpi           = {{0xbff921fb, 0x54442d18} }, /* -pi/2         */
 /**/ qpi            = {{0x3fe921fb, 0x54442d18} }, /*  pi/4         */
-/**/ qpi1           = {{0x3c81a626, 0x33145c07} }, /*  pi/4-qpi     */
 /**/ mqpi           = {{0xbfe921fb, 0x54442d18} }, /* -pi/4         */
 /**/ tqpi           = {{0x4002d97c, 0x7f3321d2} }, /*  3pi/4        */
-/**/ tqpi1          = {{0x3c9a7939, 0x4c9e8a0a} }, /*  3pi/4-tqpi   */
 /**/ mtqpi          = {{0xc002d97c, 0x7f3321d2} }, /* -3pi/4        */
 /**/ u1             = {{0x3c314c2a, 0x00000000} }, /*  9.377e-19    */
 /**/ u2             = {{0x3bf955e4, 0x00000000} }, /*  8.584e-20    */
@@ -129,10 +127,8 @@ 
 /**/ hpi1           = {{0x33145c07, 0x3c91a626} }, /*  pi/2-hpi     */
 /**/ mhpi           = {{0x54442d18, 0xbff921fb} }, /* -pi/2         */
 /**/ qpi            = {{0x54442d18, 0x3fe921fb} }, /*  pi/4         */
-/**/ qpi1           = {{0x33145c07, 0x3c81a626} }, /*  pi/4-qpi     */
 /**/ mqpi           = {{0x54442d18, 0xbfe921fb} }, /* -pi/4         */
 /**/ tqpi           = {{0x7f3321d2, 0x4002d97c} }, /*  3pi/4        */
-/**/ tqpi1          = {{0x4c9e8a0a, 0x3c9a7939} }, /*  3pi/4-tqpi   */
 /**/ mtqpi          = {{0x7f3321d2, 0xc002d97c} }, /* -3pi/4        */
 /**/ u1             = {{0x00000000, 0x3c314c2a} }, /*  9.377e-19    */
 /**/ u2             = {{0x00000000, 0x3bf955e4} }, /*  8.584e-20    */
diff --git a/sysdeps/ieee754/dbl-64/uexp.h b/sysdeps/ieee754/dbl-64/uexp.h
index 6817eaf..42b21f2 100644
--- a/sysdeps/ieee754/dbl-64/uexp.h
+++ b/sysdeps/ieee754/dbl-64/uexp.h
@@ -29,7 +29,7 @@ 
 
 #include "mydefs.h"
 
-const static double one = 1.0, zero = 0.0, hhuge = 1.0e300, tiny = 1.0e-300,
+const static double zero = 0.0, hhuge = 1.0e300, tiny = 1.0e-300,
 err_0 = 1.000014, err_1 = 0.000016;
 const static int4 bigint = 0x40862002,
              badint = 0x40876000,smallint = 0x3C8fffff;
diff --git a/sysdeps/ieee754/dbl-64/upow.h b/sysdeps/ieee754/dbl-64/upow.h
index c8569a9..b4911e5 100644
--- a/sysdeps/ieee754/dbl-64/upow.h
+++ b/sysdeps/ieee754/dbl-64/upow.h
@@ -34,7 +34,6 @@ 
 /**/ nZERO	    = {{0x80000000, 0}},	  /* -0.0          */
 /**/ INF            = {{0x7ff00000, 0x00000000}}, /* INF           */
 /**/ nINF           = {{0xfff00000, 0x00000000}}, /* -INF          */
-/**/ sqrt_2         = {{0x3ff6a09e, 0x667f3bcc}}, /* sqrt(2)       */
 /**/ ln2a           = {{0x3fe62e42, 0xfefa3800}}, /* ln(2) 43 bits */
 /**/ ln2b           = {{0x3d2ef357, 0x93c76730}}, /* ln(2)-ln2a    */
 /**/ bigu           = {{0x4297ffff, 0xfffffd2c}}, /* 1.5*2**42 -724*2**-10  */
@@ -48,7 +47,6 @@ 
 /**/ nZERO	    = {{0, 0x80000000}},	  /* -0.0          */
 /**/ INF            = {{0x00000000, 0x7ff00000}}, /* INF           */
 /**/ nINF           = {{0x00000000, 0xfff00000}}, /* -INF           */
-/**/ sqrt_2         = {{0x667f3bcc, 0x3ff6a09e}}, /* sqrt(2)       */
 /**/ ln2a           = {{0xfefa3800, 0x3fe62e42}}, /* ln(2) 43 bits */
 /**/ ln2b           = {{0x93c76730, 0x3d2ef357}}, /* ln(2)-ln2a    */
 /**/ bigu           = {{0xfffffd2c, 0x4297ffff}}, /* 1.5*2**42 -724*2**-10  */
diff --git a/sysdeps/ieee754/flt-32/e_log10f.c b/sysdeps/ieee754/flt-32/e_log10f.c
index 96f0e81..1daeef7 100644
--- a/sysdeps/ieee754/flt-32/e_log10f.c
+++ b/sysdeps/ieee754/flt-32/e_log10f.c
@@ -22,8 +22,6 @@  ivln10     =  4.3429449201e-01, /* 0x3ede5bd9 */
 log10_2hi  =  3.0102920532e-01, /* 0x3e9a2080 */
 log10_2lo  =  7.9034151668e-07; /* 0x355427db */
 
-static const float zero   =  0.0;
-
 float
 __ieee754_log10f(float x)
 {
diff --git a/sysdeps/ieee754/flt-32/s_cosf.c b/sysdeps/ieee754/flt-32/s_cosf.c
index 864ab27..0affd40 100644
--- a/sysdeps/ieee754/flt-32/s_cosf.c
+++ b/sysdeps/ieee754/flt-32/s_cosf.c
@@ -21,8 +21,6 @@  static char rcsid[] = "$NetBSD: s_cosf.c,v 1.4 1995/05/10 20:47:03 jtc Exp $";
 #include <math.h>
 #include <math_private.h>
 
-static const float one=1.0;
-
 #ifndef COSF
 # define COSF_FUNC __cosf
 #else
diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
index 500aacc..ab5a96e 100644
--- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
+++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c
@@ -82,7 +82,6 @@  DIAG_IGNORE_NEEDS_COMMENT (4.6, "-Woverflow");
 static const long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L;
 DIAG_POP_NEEDS_COMMENT;
 static const long double one = 1.0L;
-static const long double zero = 0.0L;
 static const long double huge = LDBL_MAX;
 
 /* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x P(1/x^2)
diff --git a/sysdeps/ieee754/ldbl-128/s_erfl.c b/sysdeps/ieee754/ldbl-128/s_erfl.c
index fa4609f..08c80a3 100644
--- a/sysdeps/ieee754/ldbl-128/s_erfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_erfl.c
@@ -140,7 +140,6 @@  deval (long double x, const long double *p, int n)
 
 static const long double
 tiny = 1e-4931L,
-  half = 0.5L,
   one = 1.0L,
   two = 2.0L,
   /* 2/sqrt(pi) - 1 */
diff --git a/sysdeps/ieee754/ldbl-128/s_log1pl.c b/sysdeps/ieee754/ldbl-128/s_log1pl.c
index ff759bc..9609550 100644
--- a/sysdeps/ieee754/ldbl-128/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128/s_log1pl.c
@@ -117,7 +117,6 @@  static const long double C2 = 1.428606820309417232121458176568075500134E-6L;
 
 static const long double sqrth = 0.7071067811865475244008443621048490392848L;
 /* ln (2^16384 * (1 - 2^-113)) */
-static const long double maxlog = 1.1356523406294143949491931077970764891253E4L;
 static const long double zero = 0.0L;
 
 long double
diff --git a/timezone/private.h b/timezone/private.h
index 4e8f4ae..ed19e06 100644
--- a/timezone/private.h
+++ b/timezone/private.h
@@ -326,16 +326,6 @@  const char *	scheck(const char * string, const char * format);
 #define TYPE_SIGNED(type) (((type) -1) < 0)
 #endif /* !defined TYPE_SIGNED */
 
-/* The minimum and maximum finite time values.  */
-static time_t const time_t_min =
-  (TYPE_SIGNED(time_t)
-   ? (time_t) -1 << (CHAR_BIT * sizeof (time_t) - 1)
-   : 0);
-static time_t const time_t_max =
-  (TYPE_SIGNED(time_t)
-   ? - (~ 0 < 0) - ((time_t) -1 << (CHAR_BIT * sizeof (time_t) - 1))
-   : -1);
-
 #ifndef INT_STRLEN_MAXIMUM
 /*
 ** 302 / 1000 is log10(2.0) rounded up.