public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: annoying new gcc 4.6.0 warnings.
Date: Thu, 21 Apr 2011 15:21:18 -0400	[thread overview]
Message-ID: <20110421192117.GA14249@redhat.com> (raw)

gcc 4.6.0 enables a new warning by default, which spews ~3000 lines
of extra warnings to my build. The warning looks like ..

arch/x86/kernel/cpu/cpufreq/powernow-k8.c: In function ‘pending_bit_stuck’:
arch/x86/kernel/cpu/cpufreq/powernow-k8.c:108:10: warning: variable ‘hi’ set but not used [-Wunused-but-set-variable]
arch/x86/kernel/cpu/cpufreq/powernow-k8.c: In function ‘core_voltage_pre_transition’:
arch/x86/kernel/cpu/cpufreq/powernow-k8.c:340:14: warning: variable ‘lo’ set but not used [-Wunused-but-set-variable]

In those cases, there's no bug there, the code just doesn't use all the arguments
that get passed to rdmsr...   For eg,

static int pending_bit_stuck(void)
{
        u32 lo, hi;

        if (cpu_family == CPU_HW_PSTATE)
                return 0;

        rdmsr(MSR_FIDVID_STATUS, lo, hi); 
        return lo & MSR_S_LO_CHANGE_PENDING ? 1 : 0; 
}


gcc's manpage says to dismiss this warning with attribute(unused), but sprinkling thousands
of those through the source seems pretty ugly.  As does rewriting functions
like rdmsr to handle NULL as an argument.

There might be some valid bugs found (I think DaveM found a few already) from this new
warning, but it seems like everything I've looked at so far is just noise.

Any thoughts ?

	Dave


             reply	other threads:[~2011-04-21 19:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 19:21 Dave Jones [this message]
2011-04-21 19:24 ` annoying new gcc 4.6.0 warnings Linus Torvalds
2011-04-21 19:39   ` David Daney
2011-04-21 19:44     ` Joe Perches
2011-04-21 19:58       ` Dave Jones
2011-04-21 20:08         ` Sam Ravnborg
2011-04-21 20:27           ` Dave Jones
2011-04-21 20:37             ` David Daney
2011-04-21 20:45               ` Dave Jones
2011-04-21 20:56                 ` Sam Ravnborg
2011-04-21 21:28                   ` Dave Jones
2011-04-21 21:42                     ` Sam Ravnborg
2011-04-29 15:02                     ` Michal Marek
2011-04-21 20:09         ` Linus Torvalds
2011-04-21 20:15           ` Dave Jones
2011-04-21 20:30 ` Stratos Psomadakis
2011-04-21 21:10   ` Sam Ravnborg

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=20110421192117.GA14249@redhat.com \
    --to=davej@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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