This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFC: Patch to allow compilation by Sun cc
- To: Hilfinger at nile dot gnat dot com
- Subject: Re: RFC: Patch to allow compilation by Sun cc
- From: Michael Snyder <msnyder at redhat dot com>
- Date: Fri, 02 Feb 2001 07:21:34 -0800
- CC: msnyder at cygnus dot com, ac131313 at cygnus dot com, gdb-patches at sourceware dot cygnus dot com
- References: <200102020447.UAA00122@tully.CS.Berkeley.EDU>
Paul Hilfinger wrote:
>
> > I didn't mean that sizeof (char) is never used -- just that it isn't used
> > in connection with MAX_REGISTER_RAW_SIZE or REGISTER_BYTES. The situation
> > is not beautiful now -- I just don't want to make it any uglier.
>
> I have no objection. I don't suppose type 'char' is likely to grow
> any time soon, Unicode or not.
Well, since REGISTER_BYTES and MAX_REGISTER_RAW_SIZE are
both in units of 'bytes', and alloca / malloc both accept
input in units of 'bytes', I suppose the only issue is
whether it's host bytes or target bytes, and whether the
two might be a different size. It's extremely unlikely
that this will ever be an issue, I think. To really stretch
the point, you could argue that these two constants are
defined per-target and not per-host, therefore should be
thought of as being target-bytes. But they're always used
to allocate memory on the host. So the real correction
factor, if one were to be used, would probably be
TARGET_CHAR_BIT / HOST_CHAR_BIT (or something like that).