From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753249AbcAGT5i (ORCPT ); Thu, 7 Jan 2016 14:57:38 -0500 Received: from smtprelay0091.hostedemail.com ([216.40.44.91]:60418 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753144AbcAGT5f (ORCPT ); Thu, 7 Jan 2016 14:57:35 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2559:2562:2828:2899:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3873:3874:4321:4362:5007:6119:6261:7903:7904:8660:9108:10004:10400:10848:11232:11658:11914:12043:12109:12114:12517:12519:12663:12740:13148:13230:13894:14093:14096:14097:14659:21067:21080:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: linen40_5eeae2d26c134 X-Filterd-Recvd-Size: 3171 Message-ID: <1452196651.4028.31.camel@perches.com> Subject: Re: Build failure: -Wno-unused-const-variable DNE on old GCC From: Joe Perches To: Michal Marek , Brian Norris , Michael Ellerman Cc: Anton Blanchard , Ian Munsie , Michael Neuling , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Thu, 07 Jan 2016 11:57:31 -0800 In-Reply-To: <568EC026.2020207@suse.com> References: <20160107185406.GA65420@google.com> <1452195444.4028.21.camel@perches.com> <568EC026.2020207@suse.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.3-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-01-07 at 20:44 +0100, Michal Marek wrote: > Dne 7.1.2016 v 20:37 Joe Perches napsal(a): > > On Thu, 2016-01-07 at 10:54 -0800, Brian Norris wrote: > > > I'm using a GCC 4.6.3 compiler for some compile tests, and I noticed > > > that commit 2cd55c68c0a4 ("cxl: Fix build failure due to -Wunused-variable > > > behaviour change") breaks my builds, because the > > > -Wno-unused-const-variable doesn't exist on GCC 4.6.3. > > >   drivers/misc/cxl/base.c: At top level: > > >   cc1: error: unrecognized command line option "-Wno-unused-const-variable" [-Werror] > > > Any thoughts on how to best fix this? I'd like not to have to scrounge > > > up a new cross compiler just for build tests. > > drivers/misc/cxl/Makefile:ccflags-y := -Werror -Wno-unused-const-variable > > You could take that -Wno-unused-const-variable out of the > > Makefile or maybe add something like: > > > > $(call cc-ifversion, -ge, 0530, -Wno-unused-const-variable) > > > > or whatever gcc version actually added that unused-const-variable check > > We have cc-disable-warning for this. Thanks Michal. Perhaps most uses of -Werror without some CONFIG_ guard should be removed or replaced by some other mechanism. $ git grep -E "=\s*\-Werror" | grep -v CONFIG [...] arch/alpha/lib/Makefile:ccflags-y := -Werror arch/alpha/mm/Makefile:ccflags-y := -Werror arch/alpha/oprofile/Makefile:ccflags-y := -Werror -Wno-sign-compare arch/metag/oprofile/Makefile:ccflags-y += -Werror arch/mips/Kbuild:subdir-ccflags-y := -Werror arch/sh/cchips/hd6446x/Makefile:ccflags-y := -Werror arch/sh/kernel/Makefile:ccflags-y := -Werror arch/sh/lib/Makefile:ccflags-y := -Werror arch/sh/mm/Makefile:ccflags-y := -Werror arch/sparc/kernel/Makefile:ccflags-y := -Werror arch/sparc/lib/Makefile:ccflags-y := -Werror arch/sparc/mm/Makefile:ccflags-y := -Werror arch/sparc/prom/Makefile:ccflags := -Werror drivers/gpu/drm/tilcdc/Makefile: ccflags-y += -Werror drivers/misc/cxl/Makefile:ccflags-y := -Werror -Wno-unused-const-variable drivers/scsi/aic7xxx/Makefile:ccflags-y += -Werror drivers/scsi/lpfc/Makefile:ccflags-y += -Werror