This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [patch] Factor common code for C-family and Fortran preprocessing


On Mon, 27 Sep 2010, FX wrote:

> > I think you should leave the define of __GNUG__ in c-cppbuiltin.c (just 
> > like the __GFORTRAN__ define is staying in the Fortran front-end code).  
> > You don't then need an is_cxx parameter.
> 
> Yep, but then you have to parse the BASEVER string twice, which is why I 
> decided against it. Of course, if you still think it's preferable when 
> taking this into account, I'll post an updated patch.

Parsing BASEVER is functionality that itself seems natural enough to 
factor out into a separate function.  If you're concerned about the speed 
of sscanf then make that separate function cache the results after the 
first parse.

-- 
Joseph S. Myers
joseph@codesourcery.com


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