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: c++/10882: passing and return by reference of char pointer corrupted on x86_64


Synopsis: passing and return by reference of char pointer corrupted on x86_64

State-Changed-From-To: open->closed
State-Changed-By: aj
State-Changed-When: Tue May 20 13:07:52 2003
State-Changed-Why:
    The code is invalid, you do the following basically:
    int number;
    void *ptr;
    ptr = &number;
    *ptr = NULL;
    
    Note that int is 32-bit and a pointer is 64-bit on x86-64.
    You therefore override some random memory, in this case
    the string popped_name.
    
    Since your code is not 64-bit clean, and you explicitly
    shut GCC up with casts to void, there's not much that GCC can do and it will produce this code.

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


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