This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Lazy __FUNCTION__ etc
Zack Weinberg wrote:
> I count approximately 1400 examples of this idiom in the
> linux-2.2.19pre17 source tree.
Oh well, can't change that then :-)
> I personally think that consistency between the C and C++ definitions
> of each is more important than consistency between __FUNCTION__ and
> __func__.
This difference is documented in extend.texi. It was introduced so that
_p_f_ would work in template instantiations (the alternative, I guess,
would be to delay string contatenation till then, which would be a bigger
internal change). Although __FUNCTION__ isn't affected by this, it'd
be confusing if that and _p_f_ behaved differently in the same language.
'tis unfortunate that whatever we do we're gonna end up with a wart.
> I'd rather not hack up the grammar, it's already enough of a mess.
I kind of thought you were, given that you're introducing new keywords.
> And the more I look at the C++ front end, the more I cannot understand
> how this ever worked in the first place.
Yeah, the _p_f_ handling is rather spagetti like. Do you think it would
be simpler to take separate approaches for C and C++? If you like,
I'll have a go at C++.
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org