This is the mail archive of the gcc-help@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: gcc/g++ equivalent for BC++ #pragma warn -xxx


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

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