[PATCH] Suppress certain GCC warnings in auto-generated code.

Guillem Jover guillem at hadrons.org
Sat Oct 3 18:39:35 PDT 2009


Hi!

On Fri, 2009-10-02 at 13:42:44 -0700, Jamey Sharp wrote:
> - Don't warn for references to deprecated functions in xorg_symbols.
> - Ignore functions generated by gl_apitemp.py that are never used.
> 
> Signed-off-by: Jamey Sharp <jamey at minilop.net>

> diff --git a/glx/glapi.c b/glx/glapi.c
> index fa3808e..d6a568e 100644
> --- a/glx/glapi.c
> +++ b/glx/glapi.c
> @@ -114,10 +114,15 @@ warn(void)
>     }
>  }
>  
> +#if defined(__GNUC__) && (__GNUC__ > 2)
> +#define possibly_unused __attribute((unused))
> +#else
> +#define possibly_unused
> +#endif

Or maybe define it in Xfuncproto.h.in as something like _X_UNUSED so
that other files and components can use it as well?

>  #define KEYWORD1 static
>  #define KEYWORD1_ALT static
> -#define KEYWORD2 GLAPIENTRY
> +#define KEYWORD2 GLAPIENTRY possibly_unused
>  #define NAME(func)  NoOp##func
>  
>  #define F NULL

But for documentation purposes keep the local possibly_unused defined
to _X_UNUSED?

regards,
guillem


More information about the xorg-devel mailing list