9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Mike Haertel <mike@ducky.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] compiler bug
Date: Sat, 14 Jul 2001 00:52:14 -0700	[thread overview]
Message-ID: <200107140752.f6E7qEG04063@ducky.net> (raw)
In-Reply-To: <20010714053945.A96FE199C1@mail.cse.psu.edu>

>Does this still apply if a type has been explicitly requested with a
>suffix?  Eg, is the type of 0x100000000000L "long" because of the suffix,
>or "long long" because it won't fit in anything smaller?  (assuming 32
>bit longs).

That becomes a long long because it won't fit anything smaller.

Here is a table, laboriously typed in by hand from the standard
(with abbreviations courtesy of me being a lazy bum).  For those
who might care, the table comes from section 6.4.4.1, integer
constants, on page 56 of the C99 standard.

For each combination of suffix and type of constant, this
table it gives the sequence of types that will be tried to
fit the constant.


Suffix		Decimal Constant		Hex/Octal Constant
==================================================================
none		int, long, long long		int, u. int, long, u. long, long long, u. long long

U		u. int, u. long, u. long long	u. int, u. long, u. long long

L		long, long long			long, u. long, long long, u. long long

UL		u. long, u. long long		u. long, u. long long

ll		long long			long long, u. long long

ull		u. long long			u. long long


You can download a PDF of the C99 standard for $18 from ANSI at:
http://webstore.ansi.org/ansidocstore/product.asp?sku=ANSI%2FISO%2FIEC+9899%2D1999

	Mike


  reply	other threads:[~2001-07-14  7:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-14  5:39 David Gordon Hogan
2001-07-14  7:52 ` Mike Haertel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-05-30 13:03 [9fans] Compiler bug Julius Schmidt
2014-05-30 14:56 ` Charles Forsyth
2001-07-12 13:19 [9fans] compiler bug forsyth
2001-07-12 10:33 forsyth
2001-07-12  6:27 Mike Haertel
2001-07-12 10:21 ` Boyd Roberts

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=200107140752.f6E7qEG04063@ducky.net \
    --to=mike@ducky.net \
    --cc=9fans@cse.psu.edu \
    /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).