This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] Avoid signed/unsigned comparison
- From: Mark Wielaard <mark at klomp dot org>
- To: Ulf Hermann <ulf dot hermann at qt dot io>
- Cc: elfutils-devel at sourceware dot org
- Date: Thu, 27 Apr 2017 20:24:46 +0200
- Subject: Re: [PATCH] Avoid signed/unsigned comparison
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com>
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.