------- Comment #4 from sebor at roguewave dot com 2007-02-15 23:06 ------- The wording proposed in N1970 for the C++ __func__ indentifier reads:
-1- The identifier __func__ shall be implicitly declared by the translator as if, immediately following the opening brace of each function definition, the declaration static const char __func__[] = "function-name"; appeared, where function-name is the unqualified name of the lexically enclosing function. See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1970.htm. Based on this __func__ would not be defined in a function declaration (except as an extension). Since the gcc __FUNCTION__ extension does not behave the same way as the C99 __func__ indentifier (i.e., it is defined in a function declaration, albeit to the empty string), it might be possible to extend it and make it defined "earlier," i.e., even before the opening curly brace. Another option, of course, is to undefine it and make it exactly the same as __func__. I see more value in doing the former than the latter. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30811