ANSIfy cp/parser.c
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Thu Jan 9 17:21:00 GMT 2003
> From: Gabriel Dos Reis <gdr@integrable-solutions.net>
>
> "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
>
> | not ISO C, and -pedantic will spank you for it. So "bool" should never be
> | allowed in the core compiler (well, not until GCC crushes all
> | competitors. :-)
>
> It depends on what you call "core compiler". For example, it is safe
> if prototypes are seen before actual use -- which is the case in the
> other front-ends.
Yes, "safe" if the compiler allows it, ISO C does not.
By "core compiler" I meant the parts of GCC that a stage1 compiler
would be expected to build, which today are written in K&R but in the
future I would expect they would be in strict ISO C style so that
vendor compilers would continue to be able to build stage1.
Another way of looking at it is when we eliminate K&R support we would
remove -Wtraditional, but keep -pedantic in the stage1 parts. These
are the places where you can't use "bool" as a parameter.
>
> It is an error in K&R mode.
Actually, since prototypes are elided by PARAMS and get promoted to
"int" in function definitions, you *can* use bool in K&R mode (as long
as system.h defines bool to char e.g.) It's ISO C where we have
problems. :-)
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu
More information about the Gcc-patches
mailing list