This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA/types: Clean up use of field bitsize
- From: "Paul N. Hilfinger" <hilfingr at otisco dot mckusick dot com>
- To: drow at mvista dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sun, 29 Sep 2002 22:10:10 -0700
- Subject: Re: RFA/types: Clean up use of field bitsize
- References: <20020930010515.GA27762@nevyn.them.org>
- Reply-to: Hilfinger at otisco dot mckusick dot com
> So, since I needed to gain a new field here anyway, and since I have no
> compunctions about shrinking this field a little (packed bitfields of size
> greater than a couple of words are allowed in some languages IIRC (including
> GNU C maybe? Although they are not allowed in ISO C99), but they're
> definitely dodgy), and since signed bitfields are not portable, I cleaned up
> the construct. It turned out to be painless except for making sure symbol
> readers initialized it, which was a little tedious.
Well, as it happens, Ada IS able to handle bit fields of arbitrary size.
However, given that you have left 29 bits (unsigned), and that the gain from
decreasing one's memory usage by 0.000006% (31 bits of 2**29) is insignificant
compared to the enormous cost of extracting 2**29-bit, arbitrarily aligned
fields, I'd say that this change is reasonable (:->).
P. Hilfinger
Ada Core Technologies, Inc.