This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc/g++ equivalent for BC++ #pragma warn -xxx
- To: Günter Neiß <gneiss at schoenhofer dot de>
- Subject: Re: gcc/g++ equivalent for BC++ #pragma warn -xxx
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 24 Jan 2001 17:26:38 -0200
- Cc: help-gcc at gnu dot org
- Organization: GCC Team, Red Hat
- References: <3A6F1D77.9E611008@schoenhofer.de>
On Jan 24, 2001, Günter Neiß <gneiss@schoenhofer.de> wrote:
> Most of the time I am able to modify my code to supress the warning for
> that cases.
> But I found no way to supress the warning:
> ------ taking address of temporary --------
That's because you're relying on a feature that's not supported by the
C++ standard. You can't take the address of a temporary.
The Standard-compliant work-around is to define a member function that
returns `this', and call that member function on the temporary.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me