linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Ian Munsie <imunsie@au1.ibm.com>,
	Michael Ellerman <michaele@au1.ibm.com>
Cc: linuxppc-dev <linuxppc-dev@ozlabs.org>,
	Michael Neuling <mikey@neuling.org>,
	Anton Blanchard <anton@au1.ibm.com>,
	Ian Munsie <imunsie@au1.ibm.com>
Subject: Re: cxl: Fix build failure due to -Wunused-variable behaviour change
Date: Thu, 17 Sep 2015 15:13:28 +1000 (AEST)	[thread overview]
Message-ID: <20150917051328.787D2140281@ozlabs.org> (raw)
In-Reply-To: <1442296114-16796-1-git-send-email-imunsie@au.ibm.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1886 bytes --]

On Tue, 2015-15-09 at 05:48:34 UTC, Ian Munsie wrote:
> From: Ian Munsie <imunsie@au1.ibm.com>
> 
> A recent change in gcc caused this build failure:
> 
> /var/lib/jenkins/workspace/gcc_kernel_build/linux/drivers/misc/cxl/cxl.h:72:27:
> error: ‘CXL_PSL_DLCNTL’ defined but not used [-Werror=unused-const-variable]
>  static const cxl_p1_reg_t CXL_PSL_DLCNTL  = {0x0060};
> 
> Because of this gcc commit:
> 
> Commit 1bca8cbd0c68366f07277f98ce6963e10c2aa617 by mark
> PR28901 -Wunused-variable ignores unused const initialised variables in C
> 12 years ago it was decided that -Wunused-variable shouldn't warn about
> static const variables because some code used const static char rcsid[]
> strings which were never used but wanted in the code anyway. But as the
> bug points out this hides some real bugs. These days the usage of
> rcsids is not very popular anymore. So this patch changes the default
> to warn about unused static const variables in C with
> -Wunused-variable. And it adds a new option -Wno-unused-const-variable
> to turn this warning off. For C++ this new warning is off by default,
> since const variables can be used as #defines in C++. New testcases for
> the new defaults in C and C++ are included testing the new warning and
> suppressing it with an unused attribute or using
> -Wno-unused-const-variable. gcc/ChangeLog
> 
> The cxl driver uses static consts in place of #defines in some cases
> for type safety, so this change causes the driver to fail to build on
> new copilers as these constants are not all used in every file that
> imports the header. Suppress the warning for this driver to return to
> the old behaviour of -Wunused-variable.
> 
> Reported-by: Anton Blanchard <anton@au1.ibm.com>
> Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/2cd55c68c0a49a75433b15c7

cheers

  reply	other threads:[~2015-09-17  5:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15  5:48 [PATCH] cxl: Fix build failure due to -Wunused-variable behaviour change Ian Munsie
2015-09-17  5:13 ` Michael Ellerman [this message]
2015-11-25 16:16 ` Torsten Duwe
2015-11-25 22:58   ` Anton Blanchard
2015-11-25 23:41   ` Michael Ellerman
2015-12-01 14:47     ` Torsten Duwe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150917051328.787D2140281@ozlabs.org \
    --to=mpe@ellerman.id.au \
    --cc=anton@au1.ibm.com \
    --cc=imunsie@au1.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=michaele@au1.ibm.com \
    --cc=mikey@neuling.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).