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: [PATCH 10/11] ELFv2 ABI: structure passing / return


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


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