This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11221] New: gcc 3.2.3.0 problem- Urgent
- From: "vinu_s77 at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jun 2003 14:44:06 -0000
- Subject: [Bug c/11221] New: gcc 3.2.3.0 problem- Urgent
- 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=11221
Summary: gcc 3.2.3.0 problem- Urgent
Product: gcc
Version: 3.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: vinu_s77@yahoo.com
CC: gcc-bugs@gcc.gnu.org
I am using gcc 3.2.3.0 on solaris 8 . When I compile and run this program I am
getting a segmentation fault.
But when I compile and run the same program on solaris 2.5.1 and using gcc
2.7.2.2 it is working fine. The code is as shown below.
Thanks in advance
#define INPUT (void *)1
#define OUTPUT (void *)2
int replace_io_fld(char **dst, char *val)
{
if (!strcmp(val, INPUT_s))
{
*dst = malloc(sizeof(INPUT)+1);
strcpy(*dst, INPUT);//segmentation fault
}
else if (!strcmp(val, OUTPUT_s))
{
*dst = malloc(sizeof(OUTPUT)+1);
strcpy(*dst, OUTPUT);
}
else
return FALSE;
return TRUE;
}