Re: ANSI C: variable declaration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[ This is not gcc-specific, so you'd be better with a C forum such as
comp.std.c or comp.lang.c. ]

kwama wrote:

> Document number like ISO/IEC 9899:1999 (E)
> Paragraph # x.x.x
> Page #
> Text

You won't find it anywhere in ISO/IEC 9899:1999, because that is C99
which allows this.  You'd need to look at C90 (ISO/IEC 9899:1990) or C89
(ANSI X3.159-1989).  C99 is most definitely not "ANSI C".

In _The C Programming Language, 2nd ed._ (1988) by Kernighan & Ritchie,
page 200 section A.9.3 contains the text:

> So that several statements can be used where one is expected, the 
> compound statement (also called ``block'') is provided. The body of a 
> function definition is a compound statement.
>
> compound-statement:
>  { declaration-list(opt) statement-list(opt) }

This effectively mandates that all declarations precede statements in
every block.

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux