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

Ian Romanick idr at freedesktop.org
Wed Mar 4 08:47:50 PST 2015


On 02/28/2015 10:33 AM, Ilia Mirkin wrote:
> 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)

I use that method a lot because it makes the intention very obvious,
but, as others have mentioned, it's only available in C++.

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