From patchwork Wed Oct 7 20:40:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 8988 Received: (qmail 113403 invoked by alias); 7 Oct 2015 20:40:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 113393 invoked by uid 89); 7 Oct 2015 20:40:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Message-ID: <1444250435.8687.293.camel@ubuntu-sellcey> Subject: Re: [Patch] Remove warnings from timezone build when using latest GCC From: Steve Ellcey Reply-To: To: Joseph Myers CC: Date: Wed, 7 Oct 2015 13:40:35 -0700 In-Reply-To: References: <3e5a8fac-dd5c-4cff-8b4e-a036dfeb00d9@BAMAIL02.ba.imgtec.org> MIME-Version: 1.0 On Wed, 2015-10-07 at 19:45 +0000, Joseph Myers wrote: > On Wed, 7 Oct 2015, Steve Ellcey wrote: > > > 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? > > I think adding the option is fine as long as it works with all GCC > versions supported for building glibc (whether through being directly > recognized, or through the general support for ignoring unknown -Wno- > options if no warnings are generated) and as long as there's a comment > explaining why this option is present. GCC 4.6 has no problem with the option and I think that is the oldest GCC that we support. I also added a comment about why the option is there. How does this look? Steve Ellcey sellcey@imgtec.com 2015-10-07 Steve Ellcey * 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..99566cb 100644 --- a/timezone/Makefile +++ b/timezone/Makefile @@ -63,10 +63,13 @@ tz-cflags = -DTZDIR='"$(zonedir)"' \ -DTZDEFRULES='"$(posixrules-file)"' \ -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone +# The -Wno-unused-variable flag is used to prevent GCC 6 +# from warning about time_t_min and time_t_max which are +# defined in private.h but not used. 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