This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/2979: Resulting prog crashes with segmentation fault
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/2979: Resulting prog crashes with segmentation fault
- From: galli at kwsoft dot de
- Date: 28 May 2001 15:19:05 -0000
- Reply-To: galli at kwsoft dot de
>Number: 2979
>Category: c
>Synopsis: Resulting prog crashes with segmentation fault
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon May 28 08:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Andreas Galli, Freiburg, Germany
>Release: GCC 2.95.2/3 runtime
>Organization:
>Environment:
Linux SuSE 6.4; HP-UX 10.20/11; Solaris 2.7
>Description:
Following program crashes with segmentation fault, in reason of a null pointer to the printf function.
#include <stdio.h>
char *buff;
main( int argc, char *argv[]){
buff = (char *)0;
printf("Text is [%s]\n", buff);
}
I know this is not a acceptable programming style, but:
1. it's really not easy to find the places to check it
2. native eg. from HP do handle this
Is it possible fix this (via compiler switch) or maybe workaround?
Please help me!
Regards
Andreas Galli
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: