This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] Avoid pointer type mismatch warning.
- From: Jim Meyering <jim at meyering dot net>
- To: Richard Henderson <rth at twiddle dot net>
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 12 Feb 2012 15:56:17 +0100
- Subject: Re: [PATCH 1/2] Avoid pointer type mismatch warning.
- References: <1328815501-12440-1-git-send-email-rth@twiddle.net>
Richard Henderson wrote:
> update_get_addr returns a link_map*, but the return expression
> was of type char*. Fix by relying on gcc's void* arithmetic
> extension and auto-conversion from void*.
...
> +2012-02-09 Richard Henderson <rth@twiddle.net>
> +
> + * elf/dl-tls.c (update_get_addr): Avoid pointer type mismatch warning.
...
> diff --git a/elf/dl-tls.c b/elf/dl-tls.c
...
> - return (char *) p + GET_ADDR_OFFSET;
> + return (void *) p + GET_ADDR_OFFSET;
Hi Richard,
What do you think about not relying on gcc's void* arithmetic extension?
- return (char *) p + GET_ADDR_OFFSET;
+ return (void *) ((char *) p + GET_ADDR_OFFSET);