[Mesa-dev] [PATCH 5/6] i965: Silence unused parameter warning

Ilia Mirkin imirkin at alum.mit.edu
Sat Feb 28 10:33:42 PST 2015

On Sat, Feb 28, 2015 at 1:26 PM, Carl Worth <cworth at cworth.org> wrote:
> On Fri, Feb 27 2015, Ian Romanick wrote:
>> All dd functions take a gl_context as the first parameter.  Instead of
>> removing it, just silence the warning.
> For code using gcc, I really prefer the __attribute__((__unused__))
> style, (though, obviously hidden in a reasonable looking macro). That
> results in cleaner looking code than these weird unused expressions
> being cast to void.

Another clean alternative is to leave the name of the variable out, i.e.

function(struct gl_context *)

instead of

function(struct gl_context *foo)

> Does MSVC have an equivalent? Or, does it not emit the warning in the
> first place such that we could just define the macro as empty outside of
> gcc?
> So there's room for investigation here. In the meantime:
> Reviewed-by: Carl Worth <cworth at cworth.org>
> -Carl
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

More information about the mesa-dev mailing list