This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Avoid pointer type mismatch warning.


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]