Re: __FUNCTION__ and debug.

From: Henrik Nordström <hno@dont-contact.us>
Date: Mon, 28 Oct 2002 01:20:15 +0100 (CET)

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...

Regards
Henrik
Received on Sun Oct 27 2002 - 17:20:19 MST

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