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/32174] New: Condition check for const char string fails


Ive been working on a c program that does the error 
condition check in the beginning as follows,

char *fun(str)
const char *str;
{
  if (str == NULL) <-- Error check, taking the const char variable directly.
    printf("Null string \n");
  ..............
}

But the code fails to perform the error checking
when a NULL string is passed and gives a segmentation
fault.

Did anyone face a similar problem. Please provide me some
information regarding this problem.


-- 
           Summary: Condition check for const char string fails
           Product: gcc
           Version: 3.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kmanjunat at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32174


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