This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Compatibility: g++-2.7.2 and g++-2.95.2
- To: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Subject: Re: Compatibility: g++-2.7.2 and g++-2.95.2
- From: "Ulrich Windl" <Ulrich dot Windl at rz dot uni-regensburg dot de>
- Date: Fri, 3 Mar 2000 10:20:11 +0100
- CC: bug-gcc at gnu dot org
- Organization: Universitaet Regensburg, Klinikum
- References: <5394E770D71@rkdvmks1.ngate.uni-regensburg.de> (Ulrich.Windl@rz.uni-regensburg.de)
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