Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ico!ism780c!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: (* func)(fred, bert) Message-ID: <15271@haddock.ima.isc.com> Date: 27 Nov 89 23:00:55 GMT References: <30324@iuvax.cs.indiana.edu> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 19 In article <30324@iuvax.cs.indiana.edu> bobmon@iuvax.cs.indiana.edu (RAMontante) writes: >Maybe stdlib.h or something should've included a standard prototype: > int main(int, char **, char **); >to clean up stuff like this. Firstly, the third argument to |main()| is not standard. Secondly, such a prototype would cause a wrong-argument warning if the actual definition of |main()| omits the arguments. (The Committee *did* bless this, making |main| a very special case in that it has *two* non-equivalent, valid prototypes.) The proper way to detect this error is for a High-Quality Implementation to special-case it in the compiler, so that either |int main(int, char **)| or |int main(void)| will be accepted. (Of course, if the compiler also wants to accept |int main(int, char **, char **)| or any of these with a |void| return value, that would be a perfectly valid extension.) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint