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]

[Patch] Remove warnings from timezone build when using latest GCC


This is a followup to earlier email about the change in GCC's
-Wunused-variable warning.  The top-of-tree GCC C compiler will
now warn about a constant initialized variable that is unused.

There were a number of instances of this in glibc code and all
but one of them have been fixed by removing the unused variable.

The remaining issue is in timezone/private.h, which is code
we import from the tz package.   In this header time_t_min
and time_t_max are are defined and initialized but these variables
are not used in any of the code that glibc builds (thus the 
warnings), they are used in other parts of tz that do not
get included in glibc so the tz group is probably not interested
in removing them.

After some discussion on the GCC mailing list it also appears that
this GCC behavour is not going to go away.  See:

https://gcc.gnu.org/ml/gcc-patches/2015-09/msg01103.html
https://gcc.gnu.org/ml/gcc-patches/2015-10/msg00648.html

So my question is, what do we want to do in glibc?  It seems
like there are two options, either getting the tz group to
add unused attributes to these definitions or to compile the
timezone files with the -Wno-unused-variable option.  I am
inclined to go with the second option and created a patch
to do that, what do others think?

Steve Ellcey
sellcey@imgtec.com



2015-10-07  Steve Ellcey  <sellcey@imgtec.com>

	* timezone/Makefile (CFLAGS-zic.c): Add -Wno-unused-variable.
	(CFLAGS-ialloc.c): Ditto.
	(CFLAGS-scheck.c): Ditto.


diff --git a/timezone/Makefile b/timezone/Makefile
index a0b8adb..2ddefbe 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -64,9 +64,9 @@ tz-cflags = -DTZDIR='"$(zonedir)"' \
 	    -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone
 
 CFLAGS-zdump.c = -fwrapv -DNOID $(tz-cflags) -DHAVE_GETTEXT
-CFLAGS-zic.c = -DNOID $(tz-cflags) -DHAVE_GETTEXT
-CFLAGS-ialloc.c = -DNOID -DHAVE_GETTEXT
-CFLAGS-scheck.c = -DNOID -DHAVE_GETTEXT
+CFLAGS-zic.c = -DNOID $(tz-cflags) -DHAVE_GETTEXT -Wno-unused-variable
+CFLAGS-ialloc.c = -DNOID -DHAVE_GETTEXT -Wno-unused-variable
+CFLAGS-scheck.c = -DNOID -DHAVE_GETTEXT -Wno-unused-variable
 
 # We have to make sure the data for testing the tz functions is available.
 # Don't add leapseconds here since test-tz made checks that work only without


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