Newsgroups: comp.lang.c Path: utzoo!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps From: flaps@dgp.toronto.edu (Alan J Rosenthal) Subject: Re: YALF (yet another lint foulup) Message-ID: <8901080301.AA05895@explorer.dgp.toronto.edu> Organization: Dynamic Graphics Project, University of Toronto References: <9255@smoke.BRL.MIL> <379@lakart.UUCP> <9341@ihlpb.ATT.COM> Date: Sat, 7 Jan 89 22:01:11 EST nevin1@ihlpb.UUCP (55528-Liber,N.J.) writes: >What do you do if a function is non-returning and it falls off the >bottom? Never returning is a hard property to check in C. You can't check it beforehand, but you can compile in an fprintf to stderr and an exit instead of the stack popping sequence. It's just like array bounds checking in Pascal. Sometimes you can check it at compile time, sometimes the check is delayed until run time. Of course, this check wouldn't probably be necessary to meet the definition of C. Giving an error message for explicit return statements would be sufficient. ajr -- "The goto statement has been the focus of much of this controversy." -- Aho & Ullman, Principles of Compiler Design, A-W 1977, page 54.