public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Roland Dreier <rdreier@cisco.com>, linux-kernel@vger.kernel.org
Subject: Re: C language lawyers needed
Date: Wed, 27 Aug 2008 23:17:11 +0100	[thread overview]
Message-ID: <20080827221711.GE28946@ZenIV.linux.org.uk> (raw)
In-Reply-To: <48B5CE61.8020809@zytor.com>

On Wed, Aug 27, 2008 at 03:00:01PM -0700, H. Peter Anvin wrote:
> Looks like a gcc bug to me.
>
> 0xff000000 is unsigned, like any hexadecimal constant.

Not any.  Ones that do not fit into range of int but do fit into the range
of unsigned are.

Really, folks, it's not _that_ hard:

Type sequence: int, unsigned int, long, unsigned long, long long,
unsigned long long.
With U suffix => don't bother with signed types
Without U suffix, decimal => don't bother with _un_signed types
With L suffix => don't bother with anything earlier than long
With LL suffix => don't bother with anything earlier than long long
Pick the first type that covers your value; that will be it.

In particular, 0x[0-9A-Fa-f]+ == try *everything*.

  reply	other threads:[~2008-08-27 22:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-27 21:43 C language lawyers needed Roland Dreier
2008-08-27 22:00 ` H. Peter Anvin
2008-08-27 22:17   ` Al Viro [this message]
2008-08-27 22:18     ` H. Peter Anvin
2008-08-27 22:06 ` Al Viro
2008-08-27 23:02   ` Roland Dreier
2008-09-01  6:25 ` Roland Dreier

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=20080827221711.GE28946@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdreier@cisco.com \
    /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