public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: tom st denis <tomstdenis@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Prohibited attachment type (was 0xdeadbeef)
Date: Wed, 7 Jul 2004 08:29:16 -0400	[thread overview]
Message-ID: <20040707122916.GH21264@devserv.devel.redhat.com> (raw)
In-Reply-To: <20040707114836.29295.qmail@web41103.mail.yahoo.com>

On Wed, Jul 07, 2004 at 04:48:36AM -0700, tom st denis wrote:
> --- "Richard B. Johnson" <root@chaos.analogic.com> wrote:
> > Tom is correct. A literal constant defaults to 'int'.
> 
> I did a bit more messing around with GCC and it seems in 
> 
> int x = 4;
> if (x == 0xDEADBEEF) { ... }
> 
> It will warn that 0xDEADBEEF is unsigned (which it isn't).  Either
> there is an obscure clause in the C standard [I personally don't have a
> copy of C99 nor do I plan on reading it for this] or GCC cause an
> incorrect diagnostic [which isn't in violation of the standards...]

It is certainly not obscure.
ISO C99 6.4.4.1#5 says:
The type of an integer constant is the first of the corresponding list in
which its value can be represented.

For Octal or Hexadecimal Constant and no suffix, the table lists:
int
unsigned int
long int
unsigned long int
long long int
unsigned long long int

Assuming 32-bit int, 0xdeadbeef has unsigned int type.

For Decimal Constant and no suffix, the table lists only:
int
long int
long long int
and thus assuming 32-bit int and 64-bit long, 3735928559 has long int type,
assuming 32-bit int, 32-bit long and 64-bit long long, 3735928559 has long
int type.

	Jakub

  reply	other threads:[~2004-07-07 12:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-06 21:56 0xdeadbeef vs 0xdeadbeefL David Eger
2004-07-07  0:06 ` tom st denis
2004-07-07  3:00   ` viro
2004-07-07 11:10     ` tom st denis
2004-07-07 11:18       ` Prohibited attachment type (was 0xdeadbeef) Richard B. Johnson
2004-07-07 11:48         ` tom st denis
2004-07-07 12:29           ` Jakub Jelinek [this message]
2004-07-08  5:52             ` Pavel Machek
2004-07-08 14:03               ` Jakub Jelinek
2004-07-07 12:13         ` R. J. Wysocki
2004-07-07 14:22       ` 0xdeadbeef vs 0xdeadbeefL viro
2004-07-07 18:47         ` tom st denis
2004-07-07 16:30       ` Gabriel Paubert
2004-07-07 18:41         ` tom st denis
2004-07-07 18:47           ` Christoph Hellwig
2004-07-07 18:53             ` tom st denis
2004-07-07 23:17               ` Harald Arnesen
2004-07-08  6:15               ` David Weinehall
2004-07-08  9:32               ` [OT] " Gabriel Paubert
2004-07-08 11:15                 ` viro
2004-07-08 11:55                   ` Gabriel Paubert
2004-07-08 16:41                   ` Andries Brouwer
2004-07-08 17:13                     ` Michael Driscoll
2004-07-08 17:16           ` Horst von Brand
2004-07-10  1:52           ` Andrew Rodland
2004-07-07  0:38 ` Richard B. Johnson
2004-07-07  4:52   ` David Eger
2004-07-07 11:40     ` Richard B. Johnson
  -- strict thread matches above, loose matches on Subject: below --
2004-07-07 15:57 Prohibited attachment type (was 0xdeadbeef) Ray Lee

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=20040707122916.GH21264@devserv.devel.redhat.com \
    --to=jakub@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomstdenis@yahoo.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