Re: confusing shift warning

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

 



On 4/25/08, Marko Kreen <markokr@xxxxxxxxx> wrote:
>  It seems that cgcc defaults to 64-bit on x86_64, but sparse to 32-bit.
>  Isn't it sparse bug then?  Shouldnt it follow platform defaults?

It can be fixed from cgcc side, but I still think its sparse bug,
the different defaults can still cause confusion in future.

Patch attached.

Sorry about attachement, but I don't trust gmail with copy-paste...

-- 
marko
From: Marko Kreen <markokr@xxxxxxxxx>
Date: Fri, 25 Apr 2008 11:52:47 +0300
Subject: [PATCH] cgcc: always pass -m32/-m64 to sparse on x86_64, defaulting to -m64.

Sparse internally defaults to -m32.  By explicitly giving -mXX,
cgcc now follows platform standard on x86_64 and it future-proof
against fixing sparse internal default.

Signed-off-by: Marko Kreen <markokr@xxxxxxxxx>
---
 cgcc |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/cgcc b/cgcc
index 4fab530..d80ea07 100755
--- a/cgcc
+++ b/cgcc
@@ -238,6 +238,7 @@ sub add_specs {
 		&define_size_t ($m64 ? "long unsigned int" : "unsigned int"));
     } elsif ($spec eq 'x86_64') {
 	return (' -Dx86_64=1 -D__x86_64=1 -D__x86_64__=1' .
+		($m32 ? " -m32" : " -m64") .
 		&integer_types (8, 16, 32, $m32 ? 32 : 64, 64) .
 		&float_types (1, 1, 33, [24,8], [53,11], [113,15]) .
 		&define_size_t ($m32 ? "unsigned int" : "long unsigned int"));
-- 
1.5.5.1.57.g5909c


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux