This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: new fails on gcc 3.4, i686-unknown-openbsd3.1
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: Mark Mitchell <mark at codesourcery dot com>, Marc Espie <espie at cvs dot openbsd dot org>, tech at openbsd dot org, gcc at gcc dot gnu dot org
- Date: 28 Dec 2002 15:42:51 -0200
- Subject: Re: new fails on gcc 3.4, i686-unknown-openbsd3.1
- Organization: GCC Team, Red Hat
- References: <5110B085-1A88-11D7-B063-000393A6D2F2@physics.uc.edu>
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