linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marko Kreen" <markokr@gmail.com>
To: Pavel Roskin <proski@gnu.org>
Cc: linux-sparse@vger.kernel.org
Subject: Re: confusing shift warning
Date: Fri, 25 Apr 2008 11:58:36 +0300	[thread overview]
Message-ID: <e51f66da0804250158o333eb371nbc0f810076c274cb@mail.gmail.com> (raw)
In-Reply-To: <e51f66da0804250134g7f05cc8fp9011d508f49295e3@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

On 4/25/08, Marko Kreen <markokr@gmail.com> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-cgcc-always-pass-m32-m64-to-sparse-on-x86_64-def.patch --]
[-- Type: text/x-diff; name=0001-cgcc-always-pass-m32-m64-to-sparse-on-x86_64-def.patch, Size: 947 bytes --]

From: Marko Kreen <markokr@gmail.com>
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@gmail.com>
---
 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


  reply	other threads:[~2008-04-25  8:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-25  7:53 confusing shift warning Marko Kreen
2008-04-25  8:03 ` Marko Kreen
     [not found] ` <33544769883882222@unknownmsgid>
2008-04-25  8:34   ` Marko Kreen
2008-04-25  8:58     ` Marko Kreen [this message]
     [not found]       ` <-3423297637585954490@unknownmsgid>
2008-04-25 13:37         ` Marko Kreen
     [not found]           ` <-8184754938437793631@unknownmsgid>
2008-04-25 14:37             ` Marko Kreen
2008-04-25 16:04               ` Pavel Roskin
2008-04-25 17:26                 ` Marko Kreen

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=e51f66da0804250158o333eb371nbc0f810076c274cb@mail.gmail.com \
    --to=markokr@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=proski@gnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).