The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@xenotime.net>
To: Andrew Morton <akpm@osdl.org>, len.brown@intel.com
Cc: Martin Bligh <mbligh@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH] Fix up a multitude of ACPI compiler warnings on x86_64
Date: Fri, 29 Sep 2006 16:18:52 -0700	[thread overview]
Message-ID: <20060929161852.4b6ae44a.rdunlap@xenotime.net> (raw)
In-Reply-To: <20060929150526.38eec941.akpm@osdl.org>

On Fri, 29 Sep 2006 15:05:26 -0700 Andrew Morton wrote:

> On Fri, 29 Sep 2006 14:37:58 -0700
> Martin Bligh <mbligh@google.com> wrote:
> 
> > 32bit vs 64 bit issues. sizeof(sizeof) and sizeof(pointer) is variable,
> > but we're trying to shove it into unsigned int or u32.
> >
> > ...
> >
> > -	"RSDT/XSDT length (%X) is smaller than minimum (%X)",
> > +	"RSDT/XSDT length (%X) is smaller than minimum (%lX)",
> >  	table_ptr->length,
> > -	sizeof(struct acpi_table_header)));
> > +	(unsigned long) sizeof(struct acpi_table_header)));
> > 
> 
> These two sizeof()s have already been fixed by Randy in -mm's
> acpi-fix-printk-format-warnings.patch.
> 
> Randy's fix is the preferred one: sizeof() returns size_t and size_t's are
> printed with %z - there's no need to use a typecast.
> 
> (Actually Randy used %Z which avoids the warning which old gcc emitted with
> %z, but is old-fashioned.  I'll switch that to %z).
> 
> 
> acpi-fix-printk-format-warnings.patch was submitted to the ACPI developers
> on August 14 and on September 25 but remains unmerged.

Len and I discussed that patch some.  The question about it is:
why does gcc report this at all?  Is this a gcc problem or are
we misreading it somehow?

 drivers/acpi/tables/tbget.c: In function 'acpi_tb_get_this_table':
drivers/acpi/tables/tbget.c:326: warning: format '%X' expects type 'unsigned int', but argument 5 has type 'long unsigned int'

drivers/acpi/tables/tbrsdt.c: In function 'acpi_tb_validate_rsdt':
drivers/acpi/tables/tbrsdt.c:189: warning: format '%X' expects type 'unsigned int', but argument 5 has type 'long unsigned int'

Why does it think that sizeof(struct X) is long unsigned int?
(and only on 64-bit)

---
~Randy

  reply	other threads:[~2006-09-29 23:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29 21:37 [PATCH] Fix up a multitude of ACPI compiler warnings on x86_64 Martin Bligh
2006-09-29 22:05 ` Andrew Morton
2006-09-29 23:18   ` Randy Dunlap [this message]
2006-09-29 23:38     ` Andrew Morton

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=20060929161852.4b6ae44a.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=akpm@osdl.org \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@google.com \
    /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