This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ANSIfy cp/parser.c
> From: Gabriel Dos Reis <gdr@integrable-solutions.net>
>
> "Joseph S. Myers" <jsm28@cam.ac.uk> writes:
>
> | On Thu, 9 Jan 2003, Kaveh R. Ghazi wrote:
> |
> | > Perhaps automake can help? Does anyone think adding automake
> | > conversion of the gcc dir and ansi2knr as two new beginner projects is
> | > worthwhile?
> |
> | ansi2knr is not a sensible road. The benefits of using ISO C go beyond
> | the trivial syntax changes in function declarations and definitions and
> | keeping things limited so a converter can work is a bad idea.
>
> Yeah, my "conversion" went behond mere prototyping: I made some
> functions use and return "bool" where appropriate.
> -- Gaby
Note using "bool" (i.e. char) in a prototype is a GCC extension, 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. :-)
OTOH, using "bool" as a return type is fine everywhere, even right now.
--Kaveh
PS: I agree that ansi2knr isn't good for the reasons already stated.
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu