Date: Sun, 16 Jan 2005 10:44:14 -0800 From: Tim Kientzle <kientzle@freebsd.org> To: Giorgos Keramidas <keramida@freebsd.org> Cc: Robert Watson <rwatson@freebsd.org> Subject: Re: gratuitous gcc warnings: unused function arguments? Message-ID: <41EAB5FE.30603@freebsd.org> In-Reply-To: <20050116144113.GB66854@gothmog.gr> References: <Pine.NEB.3.96L.1050116120744.50371A-100000@fledge.watson.org> <20050116144113.GB66854@gothmog.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson <rwatson@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41EAB5FE.30603>
