This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Still a lot of C++ files getting "fixed"
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Still a lot of C++ files getting "fixed"
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Wed, 26 Jan 2000 13:26:49 -0800
- Cc: austern at sgi dot com, autogen at linuxbox dot com, gcc-bugs at gcc dot gnu dot org, mark at codesourcery dot com
- References: <200001262018.PAA06499@caip.rutgers.edu>
On Wed, Jan 26, 2000 at 03:18:55PM -0500, Kaveh R. Ghazi wrote:
> > From: Zack Weinberg <zack@wolery.cumb.org>
> >
> > On Wed, Jan 26, 2000 at 12:08:49PM -0500, Kaveh R. Ghazi wrote:
> > > > From: Zack Weinberg <zack@wolery.cumb.org>
> > > >
> > > > > So it is not a great leap to do the same for -ansi. It can be
> > > > > pedantically ANSI for user code, and more relaxed about system
> > > > > headers, IMHO.
> > > >
> > > > If we're going to go down this road, we might consider also
> > > > disabling pedantic complaints about a token after #else/#endif in
> > > > the system headers. On SunOS, at least half the files modified
> > > > have only that change.
> > > > zw
> > >
> > > Sounds like a good idea.
> > >
> > > Are you volunteering to write a patch to cccp/cpplib? :-)
> >
> > I'd be happy to :)
> >
> > Here is a completely untested patch for tokens after #else/#endif.
> > I'll commit the cpplib half of it after testing.
>
> Wow, thanks! Once this is applied, you'll nuke the relevant
> fixinclude thing right?
After both cccp and cpplib DTRT, yes.
> > The C++ comments issue will be trickier - it looks like we never emit
> > warnings for them, just recognize or don't recognize. That's wrong;
> > at the very least, C89 mode -pedantic needs to give warnings.
> > I need to think about what the appropriate behavior is.
> > zw
>
> Since the "foo//*bar*/" case is valid c89, I think _not_ warning is
> perhaps the right thing to do.
I think you misunderstand. -ansi -pedantic shouldn't parse // as a
comment start at all. -std=gnu89 -pedantic should parse // as a
comment start but give a warning because an extension is being used.
(Probably only once per input file, to avoid extreme obnoxiousness.)
zw