Re: __FUNCTION__ and debug.

From: Francesco Chemolli <kinkie-ml@dont-contact.us>
Date: 05 Nov 2002 09:01:58 +0100

Henrik Nordström <hno@marasystems.com> writes:

> On 28 Oct 2002, Robert Collins wrote:
>
> > Hmm, is there a canonical site we can research this on?
>
> Well.. there might be, but a safer bet is a good C++ language reference..
> unfortunately I do not have any only mostly good but slightly dated C
> langauge reference..
>
> The GCC extensions is clearly documented in the GCC & GNU CPP manuals.
>
> In the GCC manual varargs macros is defined with the GCC syntax as a GNU C
> extension. The GNU CPP manual starts by documenting the C99 syntax, and
> then moves on to define GNU CPP extensions (the same as documented in the
> GCC manual) and their purposes.
>
> info cpp -> Macros -> Macro Varargs
>
> Now I do not have very many other C++ compilers to play with, but a quick
> test with SUNPro CC in the SourceForge compile farm clearly indicates it
> does not like vararg macros in C++ code... It does deal nicely with C99
> vararg macros in C code however.
>
> It also immediately trapped another GCC extension in trace()..
> __FUNCTION__ (and its sister __PRETTY_FUNCTION__) is a GNU CC extension..
>
> kind of invalidates the whole idea I think.. it was nice, but...

Just fall back to __FILE__ and __LINE__ which should be standard IIRC if
__FUNCTION__ is not defined, ne? That's what configure is all about after
all..

-- 
	kinkie (kinkie-ml [at] libero [dot] it)
	Random fortune, unrelated to the message:
Never try to teach a pig to sing.  It wastes your time and annoys the pig.
		-- Lazarus Long, "Time Enough for Love"
Received on Tue Nov 05 2002 - 01:01:17 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:18:37 MST