This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 10/11] ELFv2 ABI: structure passing / return
- From: Ulrich Weigand <Ulrich dot Weigand at de dot ibm dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 31 Jan 2014 16:35:02 +0100
- Subject: Re: [PATCH 10/11] ELFv2 ABI: structure passing / return
- Authentication-results: sourceware.org; auth=none
- References: <20140129050009 dot GQ4101 at adacore dot com> <201401291814 dot s0TIESsN004668 at d06av02 dot portsmouth dot uk dot ibm dot com> <20140131100946 dot GY4101 at adacore dot com>
Joel Brobecker <brobecker@adacore.com> wrote on 31.01.2014 11:09:46:
> That is indeed a good explanation. I suggest we re-use your explanation,
> or at least the second part of it, to explain why n_elts is an int
> and why the cast of field_count down to int is safe. You'll avoid
> someone like me, who is tuned to treat all casts as suspicious, from
> unmaking your choice :-).
OK, makes sense. I've added the following comment:
/* Note that field_count is LONGEST since it may hold the
size
of an array, while *n_elts is int since its value is
bounded
by the number of registers used for argument passing. The
cast cannot overflow due to the bounds checking above. */
Bye,
Ulrich