Re: [AD] -Wno-unused

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Tue, 2005-01-11 at 00:24 +1100, Peter Wang wrote:
> This is the portable way:
> 
> int foo(int x, int y)
> {
>     (void)y;
>     return x;
> }
> 

I think, the __attribute__((unused)) or the (void)variable make not much
sense, since there's no negative warning in that case. E.g.
d_my_dialog_proc(..., int c) { void(c); // use c later } never produces
a warning. We catch all the cases of unused params with an attribute or
a (void), but now introduce new cases of attribute or (void) where they
are not needed. So, no point.

But, looking into the gcc manual, I think we should change the
"-Wno-unused" to "-Wno-unused-parameter". That way, it will still not
warn about unused parameters, but it will warn about unused local
variables at least, which is a good thing.

-- 
Elias Pschernig





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/