Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Dec 2001 07:52:40 -0800
From:      "David O'Brien" <obrien@FreeBSD.org>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        Luigi Rizzo <rizzo@aciri.org>, Mark Murray <mark@grondar.za>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: Are prototypes for main() illegal by any standard ? (was Re: cvs commit: src/bin/rm rm.c src/usr.sbin/chown chown.c src/usr.sbin/dev_mkdb dev_mkdb.c
Message-ID:  <20011216075240.A29455@dragon.nuxi.com>
In-Reply-To: <p05101000b841833d4238@[128.113.24.47]>; from drosih@rpi.edu on Sat, Dec 15, 2001 at 05:53:49PM -0500
References:  <20011214094310.A25238@dragon.nuxi.com> <200112141803.fBEI3MU02957@grimreaper.grondar.org> <20011214102915.L49775@iguana.aciri.org> <p05101000b841833d4238@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Dec 15, 2001 at 05:53:49PM -0500, Garance A Drosihn wrote:
> If adding the prototype for main() does *break* something, then it
> would be helpful to find out what it is that breaks.

main() is special.  The C compiler knows it returns an int and for us,
can take up to three arguments.  Because the prototype for main() is set
in stone, that is why the user should not supply one.  Lest they will
prototype it as "void main (float, char *[])".

We would not add a prototype for printf() in a program, we would include
stdio.h instead.  This is the same with main() except rather than it
being prototyped in a header, it is prototyped w/in the compiler.

This is comming up due to a bug in a single compiler.  We have fixed that
compiler.  AFAIK the other two compilers we use at all today -- TenDRA
and Compaq's compiler does not have this bug.  So why change all this
code when we fixed things at the source of the problem?

-- 
-- David  (obrien@FreeBSD.org)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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