[Bug c/11167] Migrating application from solaris 2.5.1 to Solaris8
vinu_s77@yahoo.com
gcc-bugzilla@gcc.gnu.org
Thu Jun 12 12:44:00 GMT 2003
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
vinu_s77@yahoo.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia@physics.uc.edu
------- Additional Comments From vinu_s77@yahoo.com 2003-06-12 12:44 -------
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
More information about the Gcc-bugs
mailing list