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]
Other format: [Raw text]

Re: optimization/7884: code compiled with optimization flag causes segmentation violation on powerpc


Synopsis: code compiled with optimization flag causes segmentation violation on powerpc

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Wed Sep 11 02:18:59 2002
State-Changed-Why:
    This is not a bug, but I expected a warning (which we used
    to give). '(char *)foo' is an rvalue. the call through
    to 'char *&ref' binds an rvalue to a non-const reference.
    That is ill-formed. It binds to a temporary copy, thus
    the pointer seen by the function is not the object
    you cast.
    
    The correct solution is the cast to an lvalue,
    '(char *&)foo'

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7884


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