From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,FROM_ADDR_WS autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 16 Dec 92 20:02:05 GMT From: agate!linus!linus.mitre.org!texas!jclander@ucbvax.Berkeley.EDU (Julian C . Lander) Subject: Re: Language pitfalls (was Re: FORTRAN bug) Message-ID: <1992Dec16.200205.8912@linus.mitre.org> List-Id: In article <256@visicom.com>, rlk@VisiCom.COM (Bob Kitzberger) writes: |> eachus@oddjob.mitre.org (Robert I. Eachus) writes: |> |> > (What Robert Dewar and I objected to was that certain functions |> >whose only intended effect is to raise an exception must still contain |> >a return statement. This results in junk return statements in stubbed |> >out code, and makes a stubber much harder to write.) |> |> Robert, I can't think of a reason to have a function that does nothing |> but raise an exception... can you provide an example? (I'm not |> questioning the need for it -- just curious) |> I didn't write this one, but it is in some code I'm using. The situation is interface with C-language functions, which return error codes. The chunk of code before me (I don't know a good noun for what it is--it builds about 3 different executables) has a function called Raise_Appropriate_Exception, which raises the exception corresponding to the return code it has been passed. Since it never gets a 0 (its caller should avoid that), it doesn't return. I don't know that it's the best solution to the problem (I'm not wild about it, frankly), but that's what I have. Julian C. Lander jclander@mitre.org