public inbox for bfd@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@frob.com>
To: hjl@lucon.org (H.J. Lu)
Cc: ian@cygnus.com (Ian Lance Taylor), bfd@cygnus.com
Subject: Re: A patch for elf.c
Date: Wed, 09 Dec 1998 08:04:00 -0000	[thread overview]
Message-ID: <199812091603.LAA10873@baalperazim.frob.com> (raw)
In-Reply-To: <m0znllH-0000UXC@sea.lucon.org>

> To me, clearing memory is the super set of setting one field to
> zero. I am a better safe than sorry person. I have no time
> to second guess if there is another field I should clear.

It is indeed the superset of setting one field to zero.  The question is
whether, generically speaking, setting a field to zero is the appropriate
way to initialize it.  It is not appropriate in all cases, so clearing
memory is not necessarily a superset of appropriately initializing each field.

If I may presume to explain another's position, I think Ian (like me), also
considers himself a "better safe than sorry" person.  For us, that means it
is better to be safe by individually addressing each case with a human eye
and being sure that case is handled properly, than to be sorry by presuming
that some nonspecific blanket solution like zeroing everything will be the
appropriate way to initialize each and every field.

(What I prefer to do myself is use a debugging version of malloc that fills
newly-allocated space with a distinctive nonzero bit pattern, e.g. 0xa5a5a5a5,
that makes it unlikely that the program could happen to work if a field is
left uninitialized.)

  reply	other threads:[~1998-12-09  8:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.3.96.981208082500.26204A-100000@beezer.med.miami.edu>
1998-12-08  9:57 ` H.J. Lu
1998-12-08 10:28   ` Christopher C Chimelis
1998-12-08 11:26   ` Ian Lance Taylor
1998-12-08 11:34     ` Christopher C Chimelis
1998-12-09  7:42     ` H.J. Lu
1998-12-09  8:04       ` Roland McGrath [this message]
1998-12-09  9:35       ` Ian Lance Taylor
1998-12-09 10:03         ` Jeffrey A Law
1998-12-09 16:27         ` Stan Shebs

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=199812091603.LAA10873@baalperazim.frob.com \
    --to=roland@frob.com \
    --cc=bfd@cygnus.com \
    --cc=hjl@lucon.org \
    --cc=ian@cygnus.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).