Re: gratuitous gcc warnings: unused function arguments?

From: Tim Kientzle <kientzle_at_freebsd.org>
Date: Sun, 16 Jan 2005 10:44:14 -0800
Robert Watson <rwatson_at_freebsd.org> complained that:
> 
>>At some point in the relatively recent past, we began to generate
>>warnings for unused arguments in function definitions.  ....
>>
>>int
>>main(int argc, char *argv[])
>>{
>>
>>        if (argc != 1)ut
>>                usage();
>>
>>	dostuff();
>>}

Giorgos Keramidas suggested:
> 
> %      (void)argv;

I first saw this idiom for marking unused
arguments over 10 years ago and have used
it extensively since then.  Very portable;
highly recommended.

Tim
Received on Sun Jan 16 2005 - 17:44:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:26 UTC