WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix gcc4 compiler warning
From: Steve Dobbelstein <steved@xxxxxxxxxx>
Date: Tue, 14 Feb 2006 14:58:36 -0600
Delivery-date: Tue, 14 Feb 2006 21:10:55 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix gcc4 compiler warning, Steve Dobbelstein <=