From: Andrew Cagney <ac131313@ges.redhat.com>
To: David Carlton <carlton@math.stanford.edu>
Cc: gdb <gdb@sources.redhat.com>
Subject: Re: naive GDB programming style questions
Date: Tue, 10 Sep 2002 16:15:00 -0000 [thread overview]
Message-ID: <3D7E7D14.8090409@ges.redhat.com> (raw)
In-Reply-To: <ro18z29adty.fsf@jackfruit.Stanford.EDU>
> On 09 Sep 2002 20:52:14 -0700, David Carlton <carlton@math.Stanford.EDU> said:
>
>> On Mon, 09 Sep 2002 21:45:54 -0400, Andrew Cagney <ac131313@ges.redhat.com> 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
next prev parent reply other threads:[~2002-09-10 23:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-09 16:14 David Carlton
2002-09-09 18:45 ` Andrew Cagney
2002-09-09 20:52 ` David Carlton
2002-09-10 11:39 ` David Carlton
2002-09-10 16:15 ` Andrew Cagney [this message]
2002-09-12 11:35 ` Andrew Cagney
2002-09-10 8:56 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D7E7D14.8090409@ges.redhat.com \
--to=ac131313@ges.redhat.com \
--cc=carlton@math.stanford.edu \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox