This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/32174] New: Condition check for const char string fails
- From: "kmanjunat at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jun 2007 05:24:46 -0000
- Subject: [Bug c/32174] New: Condition check for const char string fails
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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