This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11167] Migrating application from solaris 2.5.1 to Solaris8
- 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: 12 Jun 2003 12:37:58 -0000
- Subject: [Bug c/11167] Migrating application from solaris 2.5.1 to Solaris8
- References: <20030612012646.11167.vinu_s77@yahoo.com>
- 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=11167
------- Additional Comments From vinu_s77@yahoo.com 2003-06-12 12:37 -------
Following is the scenario
#define IO_fld 0
#define INPUT_s "INPUT"
#define INPUT "input"
funcA()
{
void **dest_arr;
replace_io_fld((char **)(dest_arr+IO_fld), ptr);
}
int replace_io_fld(char **dst, char *val)
{
if (!strcmp(val, INPUT_s))
{
*dst = malloc(sizeof(INPUT)+1);
strcpy(*dst, INPUT); // segmenation fault
}
else if (!strcmp(val, OUTPUT_s))
{
*dst = malloc(sizeof(OUTPUT)+1);
strcpy(*dst, OUTPUT);
}
else
return FALSE;
return TRUE;
}
This code works fine when compiled an run on solaris 2.5.1
But when I copile and run the same code on Solaris 8 I am getting a
segmentation fault in the line shown above.
Following is the gcc option I am using while compiling.
gcc -g $(CF) -fPIC -Wmissing-prototypes -I../include