This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils 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] Avoid signed/unsigned comparison


On Thu, Apr 20, 2017 at 04:40:30PM +0200, Ulf Hermann wrote:
> Some compilers implicitly cast the result of uint_fast16_t *
> uint_fast16_t to something signed and then complain about the
> comparison to (unsigned) size_t.

Really? That is allowed? Using a signed type for uint_fast16_t?

> Casting phnum to size_t is a good idea anyway as 16bit multiplication
> can easily overflow and we are not checking for this.

OK, that seems an ok enough reason.
Applied to master.

Thanks,

Mark


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