Path: utzoo!attcan!sobmips!uunet!mailrus!sharkey!cfctech!teemc!ka3ovk!ki4pv!cdis-1!tanner From: tanner@cdis-1.uucp (Dr. T. Andrews) Newsgroups: comp.lang.c Subject: Re: (* func)(fred, bert) Summary: education required Message-ID: <7733@cdis-1.uucp> Date: 15 Nov 89 15:17:15 GMT References: <2387@stl.stc.co.uk> <744@lakart.UUCP> <0175@sheol.UUCP> <11592@smoke.BRL.MIL> Organization: CDI-DLD Lines: 33 In article <11592@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn) writes: ) [ included text on declaring "main" to be "void" instead of "int" ) for main which does not return ] ) One of them is that its type is int()(int,char**) ... start-up ) module, in environments that use one, is invoking main() ) as a function that WILL return an integer value. If you ... define ) it properly but fail to arrange for an integer to be returned, ) the startup module can get confused or simply die when the improper ) return linkage is executed. It was noted that no return linkage is executed, account of call to exit(2) or local equiv. ) However, your code is not portable. I should like to hear details of a case where the code will not work. It seems ridiculous to declare un-portable the results of a void-vs-int return linkage which is never made, and I should like to hear of an implementation where this actually fails. If no real-world example is available, I should be almost as satisfied with a conjectural example (clearly marked as conjecture). Such should prove enlightening not only to earlier posters, but to me as well. A day spent without learning SOMETHING is a poor day indeed. It seems odd that X3J11 or its members would come up with such claims about main(). It would seem to fly in the face of years of established practice of using exit(condition) as a way to terminate programs. Declaring such programs non-portable does not seem to me to be a productive use of X3J11's time; obviously, I can use a little bit of education from someone who knows better than myself. -- Mulroney: "Cut trains. Drive in | {bpa,uunet}!cdin-1!cdis-1!tanner Canada. We need the acid rain." | {attctc gatech!uflorida}!ki4pv!cdis-1!tanner