This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11167] Migrating application from solaris 2.5.1 to Solaris8


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]