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]

Re: aggressive fixincludes


> 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.


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