This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Compatibility: g++-2.7.2 and g++-2.95.2


On 3 Mar 00, at 9:46, Martin v. Loewis wrote:

> > In the documentation provided, the __FUNCTION__ is still documented.
> > Do I need a different option to enable it?
> 
> No, they are still available. However, please have a look at cp/NEWS:
> 
> *** Changes in EGCS 1.0:
> [...]
> * __FUNCTION__ and __PRETTY_FUNCTION__ are now treated as variables by the
>   parser; previously they were treated as string constants.  So code like
>   `printf (__FUNCTION__ ": foo")' must be rewritten to 
>   `printf ("%s: foo", __FUNCTION__)'.  This is necessary for templates.

Martin,

thanks for the quick and helpful answer. However, I thing this was a 
very unfortunate decision: New semantics should have used a new name.
I have some real trouble converting thinks like
``char foo[] = __FILE__ "/" __FUNCTION__;''
It seems I must write a C++ class with a constructor now, because 
string concatenation in initialization will not work any longer.

As a side-note: What is the correct preprocessor GNUC minor version 
to detect "egcs 1.0"? Maybe I want to use the older compiler...

Regards,
Ulrich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]