Jack Klein <jackklein@spamcop.net> wrote:[color=blue]
> On Sun, 24 Aug 2003 11:34:25 GMT, Kevin Easton
> <kevin@-nospam-pcug.org.au> wrote in comp.lang.c:
>[color=green]
>> Jack Klein <jackklein@spamcop.net> wrote:[color=darkred]
>> > On 23 Aug 2003 15:54:02 -0700,
jake30@bellsouth.net (j) wrote in
>> > comp.lang.c:
>> >
>> >> Sadly, I don't have a copy of the c89 standard, just a copy of the c99
>> >> standard. I was curious if in c89, the type ``long long'' is indeed
>> >> considered an extended type that may or may not be implemented by the
>> >> implementation? And if it states whether or not the size of ``long
>> >> long'' is equal to the size of ``long'' or can be greater than the
>> >> size there-of?
>> >
>> > The original C standard, as well as the C99 standard, allow a
>> > conforming implementation to provide extensions as long as they do not
>> > impact any strictly conforming program.
>> >
>> > Using the keyword long twice within one declaration is an error in a
>> > pre-C99 keyword, so an implementation is free to provide a type named
>> > "long long" as an extension. Since it is completely an extension, it
>> > can be anything at all that the implementation wants it to be.[/color]
>>
>> I believe, as a syntax error, that it must be diagnosed.
>>
>> - Kevin.[/color]
>
> Look at paragraphs 4 and 5 of Section 4 (C99):
>
> "A strictly conforming program shall use only those features of the
> language and library specified in this International Standard."
>
> ---and---
>
> "A conforming implementation may have extensions (including additional
> library functions), provided they do not alter the behavior of any
> strictly conforming program."
>
> I would say that a program containing a syntax error is *NOT* a
> strictly conforming program (first quotation). Therefore a conforming
> implementation is free to make an extension out of something that
> would otherwise be a syntax error.[/color]
I point you to Section 5 (I'm quoting here from N869):
5.1.1.3 Diagnostics
1 A conforming implementation shall produce at least one diagnostic
message (identified in an implementation-defined manner) if a
preprocessing translation unit or translation unit contains a violation
of any syntax rule or constraint, even if the behavior is also
explicitly specified as undefined or implementation-defined. Diagnostic
messages need not be produced in other circumstances.
(So an implementation can indeed provide a long long type, but it has to
say something like "Warning: You used the long long type!").
- Kevin.