[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] Fix gcc4 compiler warning


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: Steve Dobbelstein <steved@xxxxxxxxxx>
  • Date: Tue, 14 Feb 2006 14:58:36 -0600
  • Delivery-date: Tue, 14 Feb 2006 21:10:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

gcc 4 has stricter type checking.  It catches a type mismatch in
xen/arch/x86/cpu/intel.c.  The num_cpu_cores() function declares:
unsigned int eax, ebx, ecx, edx;

then calls
cpuid_count(4, 0, &eax, &ebx, &ecx, &edx);

but xen/include/asm-x86/processor.h defines:
static inline void cpuid_count(int op, int count, int *eax, int *ebx, int
*ecx, int *edx)

gcc 4 catches the type mismatch between the unsigned ints declared in
num_cpu_cores() and the ints declared in the  cpuid_count() prototype and
says:
cc1: warnings being treated as errors
cpu/intel.c: In function ?num_cpu_cores?:
cpu/intel.c:88: warning: pointer targets in passing argument 3 of
?cpuid_count? differ in signedness
cpu/intel.c:88: warning: pointer targets in passing argument 4 of
?cpuid_count? differ in signedness
cpu/intel.c:88: warning: pointer targets in passing argument 5 of
?cpuid_count? differ in signedness
cpu/intel.c:88: warning: pointer targets in passing argument 6 of
?cpuid_count? differ in signedness
make[2]: *** [cpu/intel.o] Error 1

which halts the build.

This patch changes the declaration of eax, ebx, ecx, and edx to ints to
match the cpuid_count() prototype.

Signed-off-by: Steve Dobbelstein <steved@xxxxxxxxxx>

(See attached file: num_cpu_cores_fix.patch)

Attachment: num_cpu_cores_fix.patch
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.