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/11221] New: gcc 3.2.3.0 problem- Urgent


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;
}


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