cvs commit: src/usr.sbin/nologin nologin.c

Jacques Vidrine nectar at FreeBSD.org
Wed Jan 5 07:34:34 PST 2005


On Jan 4, 2005, at 2:22 PM, Maxime Henrion wrote:

> Xin LI wrote:
>> delphij     2005-01-04 20:07:12 UTC
>>
>>   FreeBSD src repository
>>
>>   Modified files:
>>     usr.sbin/nologin     nologin.c
>>   Log:
>>   Use __unused macro instead of a bare void for main().
>>
>>   Suggested by:   nectar
>
> I bet there is a reason behind this, but I'm totally puzzled at why you
> would do such a thing.  It was much prettier and more "C" before.  
> Could
> you shed some light on this please?

The point was to kill the spurious warnings.  Marking arguments as 
"unused" accomplishes this, and indicates more clearly to readers of 
the code the intentions of the writer.  Though "int main(void)" is 
acceptable Standard C, the canonical form is preferable, IMHO.

(I emailed my suggestion privately for a reason.  This could too easily 
become a pointless style flamethread, so forgive me for not responding 
to any further messages on this point.)

Cheers,
-- 
Jacques A Vidrine / NTT/Verio
nectar at celabo.org / jvidrine at verio.net / nectar at freebsd.org



More information about the cvs-all mailing list