This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Trivial fix in value_sub
- From: Jim Blandy <jimb at redhat dot com>
- To: Jim Ingham <jingham at apple dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: 03 Apr 2002 22:54:57 -0500
- Subject: Re: Trivial fix in value_sub
- References: <775EF184-4760-11D6-A9CC-000393540DDC@apple.com>
Jim Ingham <jingham@apple.com> writes:
> So... I don't think you should keep the size at 0. This seems like
> gdb is just silently ignoring the " - x" part of what they typed, and
> you should always be explicit about what you have done. But if you
> think an error is more appropriate, I am fine with that...
Oh, no, I didn't mean to suggest that zero was the right size to use;
I agree with you completely that that would be pretty confusing.
Your story is pretty amazing --- I would never have guessed that
people actually *use* the sizeof (struct incomplete) == 1 behavior! I
think it is much more common for people to be unaware that the type is
incomplete; if this hunch is correct, then the behavior your toolbox
folks love will be very confusing. I think an error for arithmetic on
any incomplete type other than (void *) is the right thing.