This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compiler Directive to List Defined Macros?
- To: martin at loewis dot home dot cs dot tu-berlin dot de, rocombs at cs dot nmsu dot edu
- Subject: Re: Compiler Directive to List Defined Macros?
- From: Ross Combs <rocombs at cs dot nmsu dot edu>
- Date: Thu, 29 Jun 2000 16:49:50 -0600
- Cc: gcc at gcc dot gnu dot org
> > So __PRETTY_FUNCTION__ has existed for a long time in gcc? I can trust
> > that even old copies will support this?
>
> Yes. I could check when it was first introduced - but so could you.
> Then you could define a reliable test based on the values of __GNUC__
> and __GNUC_MINOR__
Look like 2.7 introduced this feature from looking at the release notes.
In 2.8 __FUNCTION__ and __PRETTY_FUNCTION__ became functions instead of
strings. I'll add in the tst like this:
#if defined(__GNUC__) && \
(__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || \
__GNUC__ > 2)
> (*) It still is, and some people claim that __func__ should have been
> one of these, also, to allow concatenation as in
>
> __FILE__ ":" __FUNCTION__
Hmm. That is how I originally tried to use it. It is also annoying that
I couldn't find a way to stringize __LINE__ and then concatenate it to
__FILE__. But such things can be worked around.
-Ross