This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: fix PR 9164


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]