On Fri, Jul 27, 2012 at 11:20:48AM +0000, Poul-Henning Kamp wrote:
> In message <20120727093824.gb56...@onelab2.iet.unipi.it>, Luigi Rizzo writes:
> 
> >The alternative way to avoid an 'unused' warning from the compiler
> >is an empty statement
> >
> >     (void)foo;
> 
> The thing I don't like about this form, is that it doesn't communicate
> your intention, only your action.
> 
> Somewhere down my TODO list I have an item to propose instead:
> 
>       typedef void unused_t;
> 
>       int main(int argc, char **argv)
>       {
> 
>               (unused_t)argc;
>               (unused_t)argv;
>               return (0);
>       }

i certainly like this better, my only concern is that some other
platform might come with an incompatible usage of the name 'unused_t'
same as it happened for __unused, and we are back with the problem.

A comment might be used to explain the intention in even more detail:

        (void)foo;      /* unused on XyBSD and Babbage-OS */

cheers
luigi
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to