From owner-freebsd-bugs Wed Oct 4 23:42:55 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id XAA21724 for bugs-outgoing; Wed, 4 Oct 1995 23:42:55 -0700 Received: from dca.net (dca.net [204.183.80.2]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id XAA21719 for ; Wed, 4 Oct 1995 23:42:51 -0700 Received: from dca.net (localhost.dca.net [127.0.0.1]) by dca.net (8.6.12/8.6.12) with SMTP id CAA08991; Thu, 5 Oct 1995 02:42:49 -0400 Date: Thu, 5 Oct 1995 02:42:47 -0400 (EDT) From: Andrew White To: freebsd-bugs@freebsd.org Subject: bug with gcc 2.6.2? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-bugs@freebsd.org Precedence: bulk FreeBSD bugs list: The following code generates a segmentation violation using gcc 2.6.2 as shipped with FreeBSD 2.0-RELEASE. It shouldn't! It seems as if any of the string functions (strcmp, strcpy, etc) bomb when invoked with a null string. I compiled this using gcc 2.3.3 under AIX 3.2.5, and it works as expected (prints "x is -1" when run). I am compiling this program (I called it test.c) with: "gcc -o test test.c"... am I missing something obvious?? Perplexed, Andrew ------test.c------- #include #include int main() { char *s; int x; s=NULL; x=strcmp(s,"test"); printf("x is %d\n",x); return 0; } ------test.c-------- awhite@dca.net http://www.dca.net/ (work-related) Andrew@White.org http://andrew.white.org/ (personal) DCANET: The Delaware Common Access Network Call (302) 654-1019 or send mail to info@dca.net for more information.