This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [COMMITTED PATCH] Use ElfW(Off) rather than off_t for offsetswithin ELF files.
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Wed, 3 Oct 2012 15:42:41 -0400
- Subject: Re: [COMMITTED PATCH] Use ElfW(Off) rather than off_t for offsetswithin ELF files.
- References: <20121002230327.28ED72C07B@topped-with-meat.com>
On Tue, Oct 2, 2012 at 7:03 PM, Roland McGrath <roland@hack.frob.com> wrote:
> On configurations where off_t is larger than ElfW(Off), there was a warning
> about casting to a pointer from a larger integer type in this line:
>
> l->l_phdr = (void *) (c->mapstart + header->e_phoff - c->mapoff);
>
> Since c->mapoff was off_t, it gave the whole expression a 64-bit type.
> There's no need for mapoff to be off_t, since it only ever holds values
> computed as ElfW(Off) anyway. Using ElfW(Off) instead saves a little
> stack space as well as avoiding that warning.
Thanks for all the cleanups!
I've been enjoying watching them go by.
Do you think we'll ever get to -Werror some day? :-)
Cheers,
Carlos.