Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: Stan Shebs <shebs@apple.com>, Michael Snyder <msnyder@cygnus.com>,
	gdb-patches@sources.redhat.com
Subject: Re: [PATCH] use memset to zero the fields of a new frame_info
Date: Sun, 20 May 2001 13:06:00 -0000	[thread overview]
Message-ID: <npr8xkmq1m.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <3B049F47.5040706@cygnus.com>

Andrew Cagney <ac131313@cygnus.com> writes:
> When it comes down to it, I'm more concerned with ensuring that all 
> memory is initialized to a well defined, machine independant, value then 
> what the value actually is.  Zero happens to be convenient.

Using memset(addr, 0, size) to clear a structure is certainly not
machine-independent.  You have no idea whether the compiler represents
integer zero, null pointers, floating-point zeros, etc. as a series of
zero bytes or not.  Using memset this way is not typesafe.

(No, I don't think this ``concern'' has any practical consequence.  I
have no opinion on the actual issue.  I just want to be a smarty
pants.)


      reply	other threads:[~2001-05-20 13:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-17 13:08 Michael Snyder
2001-05-17 13:24 ` Stan Shebs
2001-05-17 21:04   ` Andrew Cagney
2001-05-20 13:06     ` Jim Blandy [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=npr8xkmq1m.fsf@zwingli.cygnus.com \
    --to=jimb@zwingli.cygnus.com \
    --cc=ac131313@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=msnyder@cygnus.com \
    --cc=shebs@apple.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