Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jan 2005 23:11:07 +0000 (GMT)
From:      Robert Watson <rwatson@freebsd.org>
To:        Maxime Henrion <mux@freebsd.org>
Cc:        cvs-all@freebsd.org
Subject:   Re: cvs commit: src/usr.sbin/nologin nologin.c
Message-ID:  <Pine.NEB.3.96L.1050104230945.45311j-100000@fledge.watson.org>
In-Reply-To: <20050104202213.GC63028@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, 4 Jan 2005, 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? 

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? :-) 

Robert N M Watson




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1050104230945.45311j-100000>