On Wed, Oct 10, 2012 at 08:28:36PM +0000, Moore, Robert wrote:
ACPI_CAST_PTR casts via an integral type (ACPI_UINTPTR_T) which can
a different size from the ACPI_PHYSICAL_ADDRESS. gcc doesn't like
this. The number is really just an int, so just print it using "%d".
diff -ur acpica-unix-20100528.old/namespace/nsdump.c
--- acpica-unix-20100528.old/namespace/nsdump.c 2010-05-28 19:14:40.000000000 +0200
+++ acpica-unix-20100528/namespace/nsdump.c 2012-10-10 14:38:18.760798740 +0200
@@ -353,9 +353,9 @@
- AcpiOsPrintf ("ID %X Len %.4X Addr %p\n",
+ AcpiOsPrintf ("ID %X Len %.4X Addr %d\n",
- ACPI_CAST_PTR (void, ObjDesc->Processor.Address));
The reason we end up doing things like this is because "int" is 32
bits under most models (LP64, LLP64, and ILP64.) The only model
where int becomes a 64-bit value is under ILP64. So really, we have
found that the only way to output something that can change from
32-bit to 64-bit automatically (and portably) is to pretend it is a
How about using the standardized <inttypes.h>, something like:
#if ACPI_MACHINE_WIDTH == 64
#define PR_ADDRESS PRIi64
#define PR_ADDRESS PRIi32
AcpiOsPrintf ("ID %X Len %.4X Addr %" PR_ADDRESS "\n", ...)
What version of gcc are you using? We don't see this issue here
everything up to gcc version 4.7.1
gcc 4.7.1, but note that the problem was seen on ppc64 (LP64).
I was a bit surprised too by the warning, since it seemed to
be casting through the same sized integer (64 bits).
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.