This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12571] New: Function parameter and variable are allocated at the same address
- From: "sammy at ariana-dsl dot utu dot fi" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Oct 2003 17:34:48 -0000
- Subject: [Bug c/12571] New: Function parameter and variable are allocated at the same address
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12571
Summary: Function parameter and variable are allocated at the
same address
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sammy at ariana-dsl dot utu dot fi
CC: gcc-bugs at gcc dot gnu dot org
void append_exp(char *text) {
if (!text) return;
int orig_len = (v->expression) ? strlen(v->expression) : 0;
int dest_len = orig_len + strlen(text);
char *buf = NULL;
...
...
Parameter "text" and variable "buf" seems to be at the same (stack) address. So,
when buf is set to NULL the text also becomes NULL.
Target architecture is i386. Compiler parameters -g -O2 -Wall were used.
When compiling with gcc 3.2 the problem does not occur.