Re: __FUNCTION__

jtv
2002-01-08T22:57:18Z

On Tue, Jan 08, 2002 at 02:01:50PM -0800, Greg KH wrote:
>
> Can you point me to the place in the spec this is defined? I don't see
> __FUNCTION__ defined anywhere in the ISO/IEC 9899:1999 (the official C99)
> specification.

Don't have a C99 spec, but here's what info gcc has to say about it:

[...description of "function names" extension as currently found in gcc...]

Note that these semantics are deprecated, and that GCC 3.2 will
handle `__FUNCTION__' and `__PRETTY_FUNCTION__' the same way as
`__func__'. `__func__' is defined by the ISO standard C99:

The identifier `__func__' is 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 name of the lexically-enclosing
function. This name is the unadorned name of the function.

Jeroen