From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7637 invoked by alias); 10 Sep 2002 23:15:35 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 7623 invoked from network); 10 Sep 2002 23:15:34 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 10 Sep 2002 23:15:34 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 186743D3C; Tue, 10 Sep 2002 19:15:33 -0400 (EDT) Message-ID: <3D7E7D14.8090409@ges.redhat.com> Date: Tue, 10 Sep 2002 16:15:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Carlton Cc: gdb Subject: Re: naive GDB programming style questions References: <3D7D4ED2.2050401@ges.redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00086.txt.bz2 > On 09 Sep 2002 20:52:14 -0700, David Carlton said: > >> On Mon, 09 Sep 2002 21:45:54 -0400, Andrew Cagney said: > > >>> If you've a copy of the ISO C and C++ manuals, have a look at what >>> they have to say about ``NULL'' pointers. It's weird. > > >> Though if you're referring to the fact that NULL's underlying bit >> representation might not be 0, I'm not sure that's a big deal here. > > > Actually, that raises another question: if I'm allocating an array of > pointers that I want initialized to NULL, am I allowed to use > xcalloc() to handle that, or do I have to loop through the memory > myself to set all the pointers to NULL? Because the former is > technically incorrect, but I don't know if GDB runs on any platforms > for which it wouldn't work; I think I've seen parts of GDB initialize > pointers to NULL using xcalloc or memset, but maybe I'm wrong. You can use memset() and xcalloc(). Andrew