This is the mail archive of the
mailing list for the elfutils project.
Re: [PATCH] libelf: Do not cast pointer to integer in gelf_newphdr
- From: Josh Stone <jistone at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Thu, 13 Oct 2016 09:51:15 -0700
- Subject: Re: [PATCH] libelf: Do not cast pointer to integer in gelf_newphdr
On 10/13/2016 03:28 AM, Mark Wielaard wrote:
> On Tue, 2016-10-11 at 23:12 +0900, Akihiko Odaki wrote:
>> unsigned long int is not always capable to have pointer in some cases
>> (LLP64, for example).
> This makes sense, but it does change a public API. One we share with
> other libelf implementations. So I'll like to discuss this first to make
> sure this doesn't break something subtle. I believe it is binary
> compatible on any currently supported architecture. And indeed it is
> broken for any architecture that doesn't have sizeof(long) ==
> sizeof(void *). There might be some source compatibility issues. If a
> user stored the result in a long without cast that would now generate a
> warning I suppose.
You could stay integral with uintptr_t -- stdint.h is already included.