This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB 6.8.92 available for testing
> From: Tom Tromey <tromey@redhat.com>
> Date: Fri, 02 Oct 2009 11:27:12 -0600
>
> Ralf> I think, len should be size_t, like any "sizeof"'s return type.
>
> TYPE_LENGTH does not expand to sizeof.
>
> Ralf> Apart of this, I can't imagine changing this "int" into "size_t" to
> Ralf> have any negative impact.
>
> Yes, I agree.
>
> I have a slight preference for locals such as this to be declared with
> the correct-according-to-gdb type.
Seconded.
However, the idiom:
int len = TYPE_LENGTH(...);
memcpy(..., ..., len);
is used in several other places in the GDB tree. I really think that
we should fix all these cases; not just this one.