This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -std=c89 shouldn't allow post-statement declarations


On Tue, 22 Jul 2003, Jamie Zawinski wrote:

> The fact remains that the behavior of -std=c89 with respect to
> post-statement declarations was changed between 2.96 and 3.2.2.
> 
> Was this intentional?  If so, what was the rationale?  I think it 
> was a bad idea.

I don't know what this "2.96" version had in it
<http://gcc.gnu.org/gcc-2.96.html>, but since I implemented mixed
declarations and statements they've always followed the practice
established long ago about what -ansi (and now -std) does.  It's just the
same as other extensions that work with new syntax that was a syntax error
in the old standard; for example, designated initializers, for which the
C99 syntax has been supported (although not fully until more recently)  
since GCC 2.5, and for which -pedantic is needed for a warning.  (The case
of "for (int i = 0; i < 10; i++)" is special: that requires C99 mode to be
enabled with -std=c99 or -std=gnu99 (the latter of which will eventually
be the default) as it would be problematic without C99's new scopes.)  I
suppose this "2.96" version just gave a syntax error as the feature wasn't
implemented.

-- 
Joseph S. Myers
jsm@polyomino.org.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]