This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: fix PR 9164
- From: Daniel Jacobowitz <drow at false dot org>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 3 Jan 2009 22:29:48 -0500
- Subject: Re: RFA: fix PR 9164
- References: <m34p0grssm.fsf@fleche.redhat.com>
On Sat, Jan 03, 2009 at 02:19:53PM -0700, Tom Tromey wrote:
> This patch fixes PR 9164.
>
> The bug is that the result of sizeof has signed type, not unsigned.
> The C and C++ standards require an unsigned type here.
>
> This fix defers the choice of type to the language, using the existing
> language-arch machinery. I fixed the C language family, including
> ObjC, but I left the other languages unchanged. I think the language
> maintainers will have to make a change here, if one is needed or
> desired. (FWIW I don't think Java needs a change, since I don't think
> it is possible to invoke sizeof when Java is the selected language.)
>
> Built and regtested on x86-64 (compile farm).
> New test case included.
Before adding all this, do you know of any language where the signed
behavior is correct?
--
Daniel Jacobowitz
CodeSourcery