This is the mail archive of the
mailing list for the elfutils project.
Re: libelf gelf_newehdr and gelf_newphdr return types
- From: Mark Wielaard <mark at klomp dot org>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Tue, 06 Dec 2016 14:47:32 +0100
- Subject: Re: libelf gelf_newehdr and gelf_newphdr return types
On Fri, 2016-12-02 at 13:39 -0700, Ali Bahrami wrote:
> Although uintptr_t would work, it seems unnecessary. Note that freebsd
> already uses 'void *', and surely they build most of the same ELF-related
> FOSS code that we might be concerned about, so I think that the libelf
> code already has ported easily. As such, and given that 'void *' is the
> common C idiom for this sort of use, I think it would make sense to
> use it.
I was leaning towards using uintptr_t. But given that other libelf
implementations use void * already for the return type of these two
functions it does seem better to just consolidate on that. It also seems
more in line with the original intent of the gelf functions (return a
pointer to the newly constructed header or NULL of failure).