Date: Wed, 19 Dec 2001 02:43:20 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Harti Brandt <brandt@fokus.gmd.de> Cc: Erik Trulsson <ertr1013@student.uu.se>, Mark Murray <mark@grondar.za>, John Baldwin <jhb@FreeBSD.org>, "David O'Brien" <obrien@FreeBSD.org>, <cvs-all@FreeBSD.org>, <cvs-committers@FreeBSD.org>, Luigi Rizzo <rizzo@aciri.org>, Garance A Drosihn <drosih@rpi.edu> Subject: Re: Are prototypes for main() illegal by any standard ? (was Re: Message-ID: <20011219023054.I4779-100000@gamplex.bde.org> In-Reply-To: <20011218121556.U414-100000@beagle.fokus.gmd.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 18 Dec 2001, Harti Brandt wrote: > To come back to the subject: you agree, that the compiler does not supply > a prototype to main (having knowledge about main is not the same as > prototyping main()). So, if we use compiler options to give us a warning, > whenever a function is used/defined without a prototype and to turn > warnings into errors, every program, which does NOT prototype main() > should give us an error. So the right thing to do if we want those errors > is to prototype main(). I think there should only be a warning for the case where main() is completely unprototyped (not when it is implicitly prototyped by defining it using an old-style parameter lis). The warning controlled by -Wmissing-prototypes is negatively useful for main(), since it is "to detect global functions that fail to be declared in header files", but main() can't be declared in standard header files and declaring it in program header files is only useful for strange programs that call main() recursively. Bruce 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?20011219023054.I4779-100000>