From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27713 invoked by alias); 3 Jul 2002 17:46:05 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 27633 invoked by uid 71); 3 Jul 2002 17:46:03 -0000 Date: Wed, 03 Jul 2002 10:46:00 -0000 Message-ID: <20020703174603.27623.qmail@sources.redhat.com> To: bkoz@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Phil Edwards Subject: Re: libstdc++/7111: cout of null pointer causes core dump Reply-To: Phil Edwards X-SW-Source: 2002-07/txt/msg00118.txt.bz2 List-Id: The following reply was made to PR libstdc++/7111; it has been noted by GNATS. From: Phil Edwards To: rdhunt@sandia.gov Cc: gcc-gnats@gcc.gnu.org Subject: Re: libstdc++/7111: cout of null pointer causes core dump Date: Wed, 3 Jul 2002 13:45:41 -0400 On Mon, Jun 24, 2002 at 10:20:23PM -0000, rdhunt@sandia.gov wrote: > >Description: > Trying to print a null character pointer causes this program to core dump. > This works fine under GCC 2.95. I know null pointers are sensitive and > am not completely sure if this is truly a bug or what the correct way of > handling this is. It's undefined behavior, so coredumping is strictly allowed (while annoying, and obviously not friendly). As bkoz mentioned, the sources have been changed to notice and throw an exception. GCC 2.x used a completely different library as 3.x. > >How-To-Repeat: > Compile it and run it. If I change the char* to be void* it works fine. For void* I think you'd be getting a pointer address. Phil -- If ye love wealth greater than liberty, the tranquility of servitude greater than the animating contest for freedom, go home and leave us in peace. We seek not your counsel, nor your arms. Crouch down and lick the hand that feeds you; and may posterity forget that ye were our countrymen. - Samuel Adams