linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Josh Triplett <josh@joshtriplett.org>
Cc: Jeff Garzik <jeff@garzik.org>,
	linux-sparse@vger.kernel.org, Christopher Li <sparse@chrisli.org>,
	Jeff Garzik <jgarzik@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC/PATCH 2/2] sparse: Use native sizes for data types
Date: Mon, 24 Oct 2011 10:06:15 +0300	[thread overview]
Message-ID: <CAOJsxLEg+jSZGs=2_Try5yUOpip6zfLAvzqXHXhoon7Mt0JqHQ@mail.gmail.com> (raw)
In-Reply-To: <20111023171324.GA2940@leaf>

On Sun, Oct 23, 2011 at 8:13 PM, Josh Triplett <josh@joshtriplett.org> wrote:
> On Sun, Oct 23, 2011 at 11:53:00AM -0400, Jeff Garzik wrote:
>> On 10/23/2011 08:37 AM, penberg@cs.helsinki.fi wrote:
>> >From: Pekka Enberg<penberg@kernel.org>
>> >
>> >This patch is needed to fix the sparsec LLVM backend data type sizes.
>> >
>> >Cc: Christopher Li<sparse@chrisli.org>
>> >Cc: Jeff Garzik<jgarzik@redhat.com>
>> >Cc: Linus Torvalds<torvalds@linux-foundation.org>
>> >Signed-off-by: Pekka Enberg<penberg@kernel.org>
>> >---
>> >  target.c |   10 +++++-----
>> >  1 files changed, 5 insertions(+), 5 deletions(-)
>> >
>> >diff --git a/target.c b/target.c
>> >index 6a535bc..009002f 100644
>> >--- a/target.c
>> >+++ b/target.c
>> >@@ -17,9 +17,9 @@ int max_alignment = 16;
>> >  int bits_in_bool = 8;
>> >  int bits_in_char = 8;
>> >  int bits_in_short = 16;
>> >-int bits_in_int = 32;
>> >-int bits_in_long = 32;
>> >-int bits_in_longlong = 64;
>> >+int bits_in_int = sizeof(int) * 8;
>> >+int bits_in_long = sizeof(long) * 8;
>> >+int bits_in_longlong = sizeof(long long) * 8;
>> >  int bits_in_longlonglong = 128;
>> >
>> >  int max_int_alignment = 4;
>> >@@ -36,8 +36,8 @@ int max_fp_alignment = 8;
>> >  /*
>> >   * Pointer data type
>> >   */
>> >-int bits_in_pointer = 32;
>> >-int pointer_alignment = 4;
>> >+int bits_in_pointer = sizeof(void *) * 8;
>> >+int pointer_alignment = sizeof(void *);
>>
>> No objection, but ideally we should select from a target template.
>>
>> We don't want to start down the road of making runtime target
>> switching (i386/x86-64) difficult.
>
> Agreed.  The platform that sparse checks code for should not necessarily
> correlate with what sparse observes at compile-time about the build
> platform.

Sure, I'm happy to implement this in some other way if you have an
idea how to do it cleanly. My patches don't make runtime switching
harder and I think using native data type sizes for plain sparse is a
better default.

                        Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-10-24  7:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-23 12:36 [RFC/PATCH 1/2] sparse: Fix including glibc headers on x86-64 penberg
2011-10-23 12:37 ` [RFC/PATCH 2/2] sparse: Use native sizes for data types penberg
2011-10-23 15:53   ` Jeff Garzik
2011-10-23 17:13     ` Josh Triplett
2011-10-24  7:06       ` Pekka Enberg [this message]
2012-03-23  8:59 ` [RFC/PATCH 1/2] sparse: Fix including glibc headers on x86-64 Christopher Li
2012-03-23  9:01   ` Benjamin Herrenschmidt
2012-03-23  9:13     ` Christopher Li
2012-03-23 10:03       ` Christopher Li
2012-03-23 18:03         ` Josh Triplett
2012-03-23 18:29           ` Christopher Li
2012-03-23 18:47             ` Christopher Li

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='CAOJsxLEg+jSZGs=2_Try5yUOpip6zfLAvzqXHXhoon7Mt0JqHQ@mail.gmail.com' \
    --to=penberg@cs.helsinki.fi \
    --cc=jeff@garzik.org \
    --cc=jgarzik@redhat.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    --cc=torvalds@linux-foundation.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).