Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: Richard Henderson <rth@redhat.com>
Cc: Andrew Cagney <ac131313@cygnus.com>,
	Ian Lance Taylor <ian@airs.com>,
	binutils@sources.redhat.com, gdb@sources.redhat.com
Subject: Re: enum { BFD_ENDIAN_BIG, ...}
Date: Mon, 17 Dec 2001 17:44:00 -0000	[thread overview]
Message-ID: <20011218121402.S29130@bubble.sa.bigpond.net.au> (raw)
In-Reply-To: <20011217164521.C15826@redhat.com>; from rth@redhat.com on Mon, Dec 17, 2001 at 04:45:21PM -0800

On Mon, Dec 17, 2001 at 04:45:21PM -0800, Richard Henderson wrote:
> On Tue, Dec 18, 2001 at 10:59:41AM +1030, Alan Modra wrote:
> > While we're on this subject, note that initialising pointers (and FP) to
> > all-bits-zero via memset is not strictly portable.  Not all architectures
> > represent a NULL pointer as all-bits-zero.  The C-FAQ mentions a number
> > of such machines.  http://www.eskimo.com/~scs/C-faq/top.html
> 
> Whatever.  None of them are live.

Heh.  I suppose I should have admitted noticing this strict portabilty
problem at various times, and couldn't be bothered fixing occurrences.
The thing is, a number of places in binutils do

memset (structp, 0, sizeof (*structp);

structp->ptr1 = NULL;
structp->ptr2 = NULL;
.
.

as if at some stage binutils authors were concerned about this
portability issue.  Typically, not _all_ pointers in the struct are
set to NULL, likely due to bitrot.  That's mildly confusing, and should
probably be fixed.  My inclination is to remove such "unnecessary"
initialisation.

Alan


      reply	other threads:[~2001-12-18  1:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-16 17:23 Andrew Cagney
2001-12-16 21:49 ` Ian Lance Taylor
2001-12-17  7:30   ` Andrew Cagney
2001-12-17 16:29     ` Alan Modra
2001-12-17 16:46       ` Richard Henderson
2001-12-17 17:44         ` Alan Modra [this message]

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=20011218121402.S29130@bubble.sa.bigpond.net.au \
    --to=amodra@bigpond.net.au \
    --cc=ac131313@cygnus.com \
    --cc=binutils@sources.redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=ian@airs.com \
    --cc=rth@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