Date: Thu, 6 Jan 2005 10:43:56 +0000 From: Nik Clayton <nik@freebsd.org> To: Robert Watson <rwatson@freebsd.org> Cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/usr.sbin/nologin nologin.c Message-ID: <20050106104356.GB52159@clan.nothing-going-on.org> In-Reply-To: <Pine.NEB.3.96L.1050104230945.45311j-100000@fledge.watson.org> References: <20050104202213.GC63028@elvis.mu.org> <Pine.NEB.3.96L.1050104230945.45311j-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Tue, Jan 04, 2005 at 11:11:07PM +0000, Robert Watson wrote:
> On Tue, 4 Jan 2005, Maxime Henrion wrote:
> > 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?
>
> I ran into exactly the same problem I assume Xin Li is now running into
> just a few days ago: gcc warns if argc and argv are unused in the main()
> definition if they aren't referenced when running at higher WARNS levels.
> I would argue this is a bug in gcc, since main() is part of an API calling
> convention, and it doesn't matter if the arguments are unused by the
> function -- they are still provided by the caller. But then, I'm not a C
> expert, so maybe this opinion is the result of poor breeding? :-)
What's wrong with (the perfectly legal):
int
main(void)
{
...
}
or does gcc complain about that too?
N
--
FreeBSD: The Power to Serve http://www.freebsd.org/ (__)
FreeBSD Documentation Project http://www.freebsd.org/docproj/ \\\'',)
\/ \ ^
--- 15B8 3FFC DDB4 34B0 AA5F 94B7 93A8 0764 2C37 E375 --- .\._/_)
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)
iD8DBQFB3RZsk6gHZCw343URAvkNAJ9b6taGU6HrsMjQhalXzNWbOUZ3jgCeJ93p
terPGmNm6aAvC9CpXPdvLgs=
=Vi3g
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050106104356.GB52159>
