From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29996 invoked by alias); 31 May 2007 15:51:51 -0000 Received: (qmail 29975 invoked by uid 48); 31 May 2007 15:51:41 -0000 Date: Thu, 31 May 2007 15:51:00 -0000 Subject: [Bug c/32166] New: Condition check for const char string fails X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "kmanjunat at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg02827.txt.bz2 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=32166