public inbox for
help / color / mirror / Atom feed
Subject: c++/10882: passing and return by reference of char pointer corrupted on x86_64
Date: Tue, 20 May 2003 12:36:00 -0000	[thread overview]
Message-ID: <> (raw)

>Number:         10882
>Category:       c++
>Synopsis:       passing and return by reference of char pointer corrupted on x86_64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Tue May 20 12:36:00 UTC 2003
>Release:        gcc-3.2.2 and gcc-3.3
Reading specs from /home/dirkjan/compiler/opteron/gcc-3.2.2/lib/gcc-lib/x86_64-u
Configured with: ./configure --prefix=/home/dirkjan/compiler/opteron/gcc-3.2.2 -
-disable-multilib --enable-languages=c,c++
Thread model: posix
gcc version 3.2.2
compilation of the following source results in overwriting the char pointer of name. using the second_function there is no problem as well after interchanging the order of the two statements in get_string

include <iostream>
using namespace std;

char* name;
char* ret_string="returned string";

void* first_function(void **data)

void* second_function(int *data)

void* third_function(void **data)

void get_string(){
    char* popped_name;
    int number;

    cout<<"start test"<<endl;
    cout<<"name is "<<name<<endl;
    cout<<"name is after functions "<<name<<endl;
this does only fail on the opteron/x86_64
compilation and run will show the last cout not printing name


             reply	other threads:[~2003-05-20 12:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-20 12:36 dirkjan [this message]
2003-05-20 13:07 aj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).