[Mesa-dev] [PATCH] mapi: Don't rely on GNU void pointer arithmetic.

Brian Paul brianp at vmware.com
Fri Feb 27 12:08:56 PST 2015


Reviewed-by: Brian Paul <brianp at vmware.com>

On 02/27/2015 12:48 PM, Matt Turner wrote:
> Commit 79daa510c added -Werror=pointer-arith to CFLAGS, which makes
> arithmetic on void pointers an error.
>
> See https://urldefense.proofpoint.com/v2/url?u=https-3A__gcc.gnu.org_onlinedocs_gcc_Pointer-2DArith.html&d=AwIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=052IAVVedL2BjCrjLEKZyknhccNH2rRlkI7SbID7plM&s=-UFZqd1Gq_A5k0EdW7bztw7O_NkXz_AiMFNnu7FhuS4&e=
> ---
>   src/mapi/entry_x86-64_tls.h | 2 +-
>   src/mapi/entry_x86_tls.h    | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/mapi/entry_x86-64_tls.h b/src/mapi/entry_x86-64_tls.h
> index 71e9d60..d571df9 100644
> --- a/src/mapi/entry_x86-64_tls.h
> +++ b/src/mapi/entry_x86-64_tls.h
> @@ -88,7 +88,7 @@ entry_generate(int slot)
>         0x41, 0xff, 0xa3, 0x34, 0x12, 0x00, 0x00,
>      };
>      unsigned long addr;
> -   void *code;
> +   char *code;
>      mapi_func entry;
>
>      addr = x86_64_current_tls();
> diff --git a/src/mapi/entry_x86_tls.h b/src/mapi/entry_x86_tls.h
> index fa7bc15..df31dce 100644
> --- a/src/mapi/entry_x86_tls.h
> +++ b/src/mapi/entry_x86_tls.h
> @@ -113,7 +113,7 @@ entry_generate(int slot)
>         0xff, 0xa0, 0x34, 0x12, 0x00, 0x00, /* jmp *0x1234(%eax) */
>         0x90, 0x90, 0x90, 0x90              /* nop's */
>      };
> -   void *code;
> +   char *code;
>      mapi_func entry;
>
>      code = u_execmem_alloc(sizeof(code_templ));
>



More information about the mesa-dev mailing list