From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7498 invoked by alias); 10 Sep 2002 03:52:15 -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 7490 invoked from network); 10 Sep 2002 03:52:15 -0000 Received: from unknown (HELO jackfruit.Stanford.EDU) (171.64.38.136) by sources.redhat.com with SMTP; 10 Sep 2002 03:52:15 -0000 Received: (from carlton@localhost) by jackfruit.Stanford.EDU (8.11.6/8.11.6) id g8A3qED31784; Mon, 9 Sep 2002 20:52:14 -0700 X-Authentication-Warning: jackfruit.Stanford.EDU: carlton set sender to carlton@math.stanford.edu using -f To: Andrew Cagney Cc: gdb Subject: Re: naive GDB programming style questions References: <3D7D4ED2.2050401@ges.redhat.com> Content-Type: text/plain; charset=US-ASCII From: David Carlton Date: Mon, 09 Sep 2002 20:52:00 -0000 In-Reply-To: <3D7D4ED2.2050401@ges.redhat.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) MIME-Version: 1.0 X-SW-Source: 2002-09/txt/msg00067.txt.bz2 On Mon, 09 Sep 2002 21:45:54 -0400, Andrew Cagney said: > I'll assume that you ment ``p_is_null()''. Right. > 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. Really? Hmm. I know that NULL doesn't work as well in C++ as it does in C, so I've gotten used to using 0 there. 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. > Anyway, for GDB, ``p == NULL'' is recommended to make it clear that > the pointer is being tested and not the underlying value. Okay, then that's what I'll do. > Just use: > struct foo > { > int mem; > }; > which is what is output by gdb_indent.sh and emacs. Excellent. David