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: new fails on gcc 3.4, i686-unknown-openbsd3.1


On Dec 28, 2002, Andrew Pinski <pinskia@physics.uc.edu> wrote:

> #define __END_DECLS     };

> Note the semicolon after }, that is what is causing it.

Looks like a job for fixheaders...  They headers are obviously in
error.

That said, it would be nice if the new parser would accept such
gratuitous constructs, even if they're not legal C++.  Even though,
grammatically, they seem to be acceptable:

declaration -> block-declaration -> simple-declaration ->
decl-specifier-seqopt init-declarator-listopt;

[dcl.dcl]/3 rules out the empty init-declarator-listopt.
Nevertheless, I think it's a mistake to outright reject programs that
contain such gratuitous semicolons.  Given the number of occurrences
of such constructs in testcases and GCC's libraries, it's obvious that
a lot of code out there will be gratuitously (?) broken by this
change.

Mark, would it be too hard to accept such empty declarations, for the
sake of backward-compatibility, perhaps emitting a warning for this
deprecated extension, and make it an error only in a future release?
Or perhaps we might even want to accept it indefinitely as a GNU
extension.  Any reason not to?  (Not that the extension would solve
OpenBSD's problem, given that the C++ testsuite runs with -ansi)

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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