Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-06-22 14:44:35


Pavel Vozenilek wrote:
> "Gennaro Prota" wrote:
>
>>> __PRETTY_FUNCTION__
>>> doesn't work, just tried.
>>
>> If what is said here is true:
>>
>> http://www.digitalmars.com/archives/cplusplus/3997.html
>>
>> then the macro is quite unreliable (like the compiler, anyway). This
>> other page:
>>
>
> __FUNCTION__ looks working.
> A bug report for __PRETTY_FUNCTION__ has been sent.

What do you mean by "working"? Does __PRETTY_FUNCTION__ not work? 'Cause I
already committed your suggestion to enable it. :-)

If by "working" you mean that #ifdef works, this is not guaranteed (unless
DMC specifically documents it to work, of course). __func__ and equivalents
aren't required to be macros. They are required to be "predefined
identifiers" that name a character string, not necessarily a literal.

C99 says:

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 name of the lexically-enclosing
function.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk