From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id C287E1A0202 for ; Fri, 8 Jan 2016 07:26:22 +1100 (AEDT) From: Arnd Bergmann To: linuxppc-dev@lists.ozlabs.org Cc: Brian Norris , Michael Ellerman , Michael Neuling , Anton Blanchard , linux-kernel@vger.kernel.org, Michal Marek , Ian Munsie Subject: Re: Build failure: -Wno-unused-const-variable DNE on old GCC Date: Thu, 07 Jan 2016 21:25:51 +0100 Message-ID: <10821353.mAlCTdTQBC@wuerfel> In-Reply-To: <20160107185406.GA65420@google.com> References: <20160107185406.GA65420@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Thursday 07 January 2016 10:54:06 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. > This should do: diff --git a/drivers/misc/cxl/Makefile b/drivers/misc/cxl/Makefile index 6982f603fadc..add2cc17ed91 100644 --- a/drivers/misc/cxl/Makefile +++ b/drivers/misc/cxl/Makefile @@ -1,4 +1,4 @@ -ccflags-y := -Werror -Wno-unused-const-variable +ccflags-y := -Werror $(call cc-disable-warning,unused-const-variable) cxl-y += main.o file.o irq.o fault.o native.o cxl-y += context.o sysfs.o debugfs.o pci.o trace.o Alternatively, remove the -Werror. We occasionally get people that add this flag to a Makefile, but it tends to cause more trouble whenever a new gcc version arrives. Arnd