From: david carlton <carlton@math.stanford.edu>
To: gdb-patches@sources.redhat.com
Cc: carlton@math.stanford.edu
Subject: superfluous line in hpread.c
Date: Thu, 01 Aug 2002 15:35:00 -0000 [thread overview]
Message-ID: <15689.47047.286781.306836@jackfruit.Stanford.EDU> (raw)
While in the middle of trying to track down a bug involving static
data members, I noticed that hpread.c(hpread_read_struct_type)
contains the consecutive lines
FIELD_BITSIZE (list->field) = -1; /* indicates static member */
SET_FIELD_PHYSNAME (list->field, 0); /* initialize to empty */
Given the following definitions from gdbtypes.h:
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
#define SET_FIELD_PHYSNAME(thisfld, name) \
((thisfld).bitsize = -1, FIELD_PHYSNAME(thisfld) = (name))
the first of those lines is completely superfluous and potentially a
bit confusing (e.g. to somebody either trying to track down a bug
involving static members or one involving bitfields).
Here's a patch that deletes it. No, I haven't tested it (I don't have
access to an appropriate machine), but it really does follow from the
definitions of the macros that that first line does nothing that the
second line doesn't also do.
David Carlton
carlton@math.stanford.edu
2002-08-01 david carlton <carlton@math.stanford.edu>
* hpread.c (hpread_read_struct_type): Deleted superfluous setting
of FIELD_BITSIZE.
Index: hpread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpread.c,v
retrieving revision 1.21
diff -c -p -r1.21 hpread.c
*** hpread.c 14 Jun 2002 14:34:25 -0000 1.21
--- hpread.c 1 Aug 2002 22:25:48 -0000
*************** hpread_read_struct_type (dnttpointer hp_
*** 4038,4044 ****
list = new;
list->field.name = VT (objfile) + fn_fieldp->dsvar.name;
- FIELD_BITSIZE (list->field) = -1; /* indicates static member */
SET_FIELD_PHYSNAME (list->field, 0); /* initialize to empty */
memtype = hpread_type_lookup (fn_fieldp->dsvar.type, objfile);
--- 4038,4043 ----
next reply other threads:[~2002-08-01 22:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-01 15:35 david carlton [this message]
2002-08-02 11:30 ` Joel Brobecker
2002-08-04 12:11 ` Andrew Cagney
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=15689.47047.286781.306836@jackfruit.Stanford.EDU \
--to=carlton@math.stanford.edu \
--cc=gdb-patches@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