Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 03 Jul 2005 01:11:51 -0000
From:      des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To:        Jacques Vidrine <nectar@FreeBSD.org>
Cc:        Maxime Henrion <mux@freebsd.org>, cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Xin LI <delphij@FreeBSD.org>, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.sbin/nologin nologin.c
Message-ID:  <xzpk6px26ov.fsf@dwp.des.no>
In-Reply-To: <4A4547FB-5F2F-11D9-96EE-000A95BC6FAE@FreeBSD.org> (Jacques Vidrine's message of "Wed, 5 Jan 2005 09:34:29 -0600")
References:  <200501042007.j04K7Ch1043130@repoman.freebsd.org> <20050104202213.GC63028@elvis.mu.org> <4A4547FB-5F2F-11D9-96EE-000A95BC6FAE@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Jacques Vidrine <nectar@FreeBSD.org> writes:
> On Jan 4, 2005, at 2:22 PM, Maxime Henrion wrote:
> > Xin LI wrote:
> > >   Modified files:
> > >     usr.sbin/nologin     nologin.c
> > >   Log:
> > >   Use __unused macro instead of a bare void for main().
> > 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.

Neither is correct; the proper solution (with ample precedent in
FreeBSD) is to call getopt() with an empty option string.

Furthermore, if __unused is to be used at all, it should be after the
argument name, not before its type.

DES
--=20
Dag-Erling Sm=F8rgrav - des@des.no




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpk6px26ov.fsf>