This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: aggressive fixincludes
- To: Per Bothner <per at bothner dot com>
- Subject: Re: aggressive fixincludes
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Wed, 24 Nov 1999 18:58:55 +0000
- Cc: gcc at gcc dot gnu dot org, autogen at linuxbox dot com
- Cc: richard dot earnshaw at arm dot com
- Organization: ARM Ltd.
- Reply-To: richard dot earnshaw at arm dot com
> korbb@sourceware.cygnus.com writes:
>
> > > I guess it can happen on platforms where the vendor C compiler
> > > allows //-comments. But is this a real problem?
> >
> > Yes, as long as -ansi disables //-comment processing.
>
> Let's see: If the vendor supplies C header files containing C++-style
> comments, and if a programmer includes that in a C file, and if
> the programer uses -ansi, then something might break.
>
> Can I put on my curmudgeon hat and say "then don't do that"?
>
> Why do we really need to support compiling with -ansi when
> including a non-ANSI header file in a C program?
Because some vendors wouldn't recognize a C standard it if hit them. The
amount of code that purports to be ANSI C code, but is in fact nothing of
the sort, has to be seen to be believed.
That doesn't mean that I don't want *my* program to be clean ANSI C.
Of course another solution would be:
#pragma sloppy_vendor_header ON
#include "sloppy_vendor_header.h"
#pragma sloppy_vendor_header OFF
But for some reason pragmas are out, and we must use __attribute__!
R.