Re: is order urgent doubt
- From: Eric Sosman <Eric.Sosman@xxxxxxx>
- Date: Tue, 03 Jun 2008 18:05:08 -0400
jacob navia wrote:
Walter Roberson wrote:In article <g248q6$3u7$1@xxxxxxxx>, jacob navia <jacob@xxxxxxxxxx> wrote:
6.7.2 Type specifiers
Each list of type specifiers shall be one of the following sets (delimited by commas, when there is
more than one set on a line); the type specifiers may occur in any order, possibly
intermixed with the other declaration specifiers.
Notice that bit about "in any order". So long long int is the
same as long int long .
And why is not long int, then long?
... but it is: All of `long', `long int', and `int long'
describe the same type.
What about
int int int m;
Doesn't match any of the combinations listed as legal,
and is thus illegal.
And any kind of nonsense you can think about?
long signed long int,
Legal.
signed long int long,
Legal.
signed long signed long,
Illegal; no listed combination has `signed' twice.
signed int long signed long int
Illegal; no listed combination has `signed' twice or
`int' twice.
long int long int
long int int long
Both illegal; no listed combination has `int' twice.
I just use the last one parsed.
As long as you issue a diagnostic for the unlicensed
combinations, you can do whatever you like with the faulty
source code. (Hmmm: How do you distinguish `long' from
`long long' on a "last one parsed" basis? Maybe that's
the crux of the issue ...)
I'll agree that the Standard's language in this section
is deficient in one respect: It speaks of the combinations
as "sets" when it really ought to say "multisets." In C89
"sets" was fine, but C99's introduction of `long long' brought
in the notion of the number of times an element is present,
and this is foreign to a plain set (it either contains the
element or it does not; there's no "how many" idea). By
concentrating too closely on the "set" notion you may have
been misled into thinking that `double double trouble;' is
a legitimate declaration of what's normally called a `double',
but it's not.
--
Eric.Sosman@xxxxxxx
.
- Follow-Ups:
- Re: is order urgent doubt
- From: lawrence . jones
- Re: is order urgent doubt
- References:
- is order urgent doubt
- From: new to c
- Re: is order urgent doubt
- From: jacob navia
- Re: is order urgent doubt
- From: Flash Gordon
- Re: is order urgent doubt
- From: jacob navia
- Re: is order urgent doubt
- From: Walter Roberson
- Re: is order urgent doubt
- From: jacob navia
- is order urgent doubt
- Prev by Date: Re: Implicit loop and reading in an unknown number of variables
- Next by Date: Re: When to use const modifier?
- Previous by thread: Re: is order urgent doubt
- Next by thread: Re: is order urgent doubt
- Index(es):
Relevant Pages
|