RFC: __FUNCTION__ and __PRETTY_FUNCTION__

Neil Booth neil@daikokuya.demon.co.uk
Sun Dec 9 15:02:00 GMT 2001


Joseph S. Myers wrote:-

> I think we should make them follow the C99 definition of __func__.

OK, I'm all for that.  I've had one other vote in favour of consistency
with g++.

> You'll need to decide whether they should be three distinct objects even
> if their contents are all the same; they probably should (be distinct from
> each other and from string literals) for consistency with __func__.

Are you saying that, within the same function, __func__ and
__FUNCTION__ should be distinct?  I'm not persuaded.  I'm guessing
that the reason the standard specified the uniqueness criterion was so
that you could easily compare functions based on __func__ (quite why
you might want to do this isn't so clear to me).  If the pointers are
the same, then you unambiguously have the same function.

Do you find this reasoning persuasive?  I'm concerned about having the
three distinct for the same function; having them the same seems
better to me on first thoughts.

If I produced a patch to do one or the other, would you accept it for
3.1?

Neil.



More information about the Gcc mailing list