barrett@jhunix.HCF.JHU.EDU (Dan Barrett) (02/15/90)
I informed Mike Spille of Manx about the bug I mentioned in this group (getchar() at EOF causes the operating system to say "cannot load file"). Indeed, _main() is returning -1 to the operating system, causing this error. The workaround is to explicit return(0) or exit(0) in your main(). However, Manx does NOT plan to fix this bug! Here is the response. >Date: 14 Feb 90 16:46:33 EST >From: Mike Spille/Manx <71545.1466@CompuServe.COM> >To: <barrett> >Subject: Re: Bug in getchar() reported by me earlier > >We do not plan to change this behavior, as with the current library >implimentation it would not be easy to do so (this is because it's not >possible to tell whether or not any value was actually returned from >main() or not). Incidentally, you can say return (0) instead of >exit (0), from within main, if you prefer that syntax. > > -Mike Yecch. Dan //////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ | Dan Barrett, Department of Computer Science Johns Hopkins University | | INTERNET: barrett@cs.jhu.edu | | | COMPUSERVE: >internet:barrett@cs.jhu.edu | UUCP: barrett@jhunix.UUCP | \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////////
peter@sugar.hackercorp.com (Peter da Silva) (02/16/90)
In article <4228@jhunix.HCF.JHU.EDU> barrett@jhunix.HCF.JHU.EDU (Dan Barrett) writes: > >From: Mike Spille/Manx <71545.1466@CompuServe.COM> > >We do not plan to change this behavior, as with the current library > >[...] because it's not possible to tell whether or not any value was > >actually returned from main() or not. > Yecch. They're right. Main() should return a valid value, either by calling exit() or by calling return with a value. Falling off the end of main() is not a valid way to return from a program. -- _--_|\ Peter da Silva <peter@sugar.hackercorp.com>. / \ \_.--._/ I haven't lost my mind, it's backed up on tape somewhere! v "Have you hugged your wolf today?" `-_-'
bluneski@pogo.WV.TEK.COM (Bob Luneski) (02/17/90)
barrett@jhunix.HCF.JHU.EDU (Dan Barrett) writes: > I informed Mike Spille of Manx about the bug I mentioned in this >group (getchar() at EOF causes the operating system to say "cannot load >file"). Indeed, _main() is returning -1 to the operating system, causing >this error. The workaround is to explicit return(0) or exit(0) in your >main(). > Yecch. It is never a good idea to assume something will be done for you. By explicitly specifying your exit condition the "work around" is just good programming practice. ____________________________________________________________________________ Bob Luneski The opinions expressed herein are my own and in no way reflect the opinions of Tektronix, Inc.
root@trlluna.trl.oz (System PRIVILEGED Account) (02/19/90)
> _--_|\ Peter da Silva <peter@sugar.hackercorp.com>. > / \ > \_.--._/ I haven't lost my mind, it's backed up on tape somewhere! > v "Have you hugged your wolf today?" `-_-' From: aduncan@rhea.trl.oz.au (Allan Duncan) Path: rhea.trl.oz.au!aduncan ^^^^^^^ Any reason for the wolf to have gone Australian? Allan Duncan ACSnet aduncan@rhea.trl.oz ARPA aduncan%rhea.trl.oz.au@uunet.uu.net UUCP {uunet,hplabs,ukc}!munnari!rhea.trl.oz.au!aduncan Telecom Research Labs, PO Box 249, Clayton, Victoria, 3168, Australia.