From owner-freebsd-stable Wed Oct 9 8:41:29 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C30E837B401 for ; Wed, 9 Oct 2002 08:41:27 -0700 (PDT) Received: from post-20.mail.nl.demon.net (post-20.mail.nl.demon.net [194.159.73.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23AE843E6E for ; Wed, 9 Oct 2002 08:41:27 -0700 (PDT) (envelope-from cls@raggedclown.net) Received: from [212.238.197.102] (helo=mailhost.raggedclown.net) by post-20.mail.nl.demon.net with esmtp (Exim 3.36 #1) id 17zIxi-000K28-00 for freebsd-stable@freebsd.org; Wed, 09 Oct 2002 15:41:26 +0000 Received: from willow.raggedclown.net (willow.raggedclown.intra [192.168.1.10]) by mailhost.raggedclown.net (Ragged Clown Mail Gateway [oz]) with ESMTP id 886234881D for ; Wed, 9 Oct 2002 17:41:25 +0200 (CEST) Received: by willow.raggedclown.net (Ragged Clown Host [willow], from userid 1009) id D3041225CF; Wed, 9 Oct 2002 17:41:25 +0200 (CEST) Date: Wed, 9 Oct 2002 17:41:25 +0200 From: Cliff Sarginson To: freebsd-stable@freebsd.org Subject: Re: gcc2.95.4 pointer not defined Message-ID: <20021009154125.GB797@raggedclown.net> References: <20021009151803.GA14701@copper.eng.cstone.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021009151803.GA14701@copper.eng.cstone.net> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, Oct 09, 2002 at 11:18:03AM -0400, Joe Talbott wrote: > With the following simple program on 4.6-STABLE from Mon Sep 9 11:27:32 EDT > 2002 roughly (tried as well on 4.6-STABLE from Mon Jun 24 18:24:30 EDT 2002) > both gcc 2.95.4 20020320. Both give SIGSEGV on line 9 (*ip = 50). gdb tells > me: > > ip = (int *) 0x0 > > Here's the source: > /* pointer.c - pointer test */ > > #include > #include > > int main (void) { > int *ip; > > *ip = 50; > > printf ("%d\n", *ip); > > return (EXIT_SUCCESS); > } > > I've tried this on a RedHat box and a SunOS box both worked as expected. > > Joe Mmm..well they may have worked "as expected" but a SIGSEGV is what I would expect. Where exactly is "ip" pointing to ? Maybe it needs some space to point to ! And the Sunos C compiler is not a good reference point for acceptable "C" ! You would be amazed at the things it lets by that are wrong. -- Regards Cliff Sarginson The Netherlands Email: cls@raggedclown.net Tel : +31 (0)10 4764595 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message