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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 16 Dec 92 17:27:17 GMT From: wdl39!mab@ford-wdl1.arpa (Mark A Biggar) Subject: Re: Language pitfalls (was Re: FORTRAN bug) Message-ID: <1992Dec16.172717.19807@wdl.loral.com> List-Id: In article eachus@oddjob.mitre.org (Rob ert I. Eachus) writes: >In article <1992Dec15.203558.18211@inmet.camb.inmet.com> stt@spock.camb.inmet. com (Tucker Taft) writes: > Oh boy. That is a nasty one. This argues for a "friendly" > Ada compiler giving a warning about any use of "null;" other > than the idiomatic ones like "when others => null;" or "begin null; end;" > (especially in a function that returns an access type ;-). > In retrospect, one could argue that it would have been better > to have no "null" statement at all (other than simply ";") than > to create a situation allowing this kind of one word error. > Actually, there is an Ada rule which normally catches this, and >which Robert Dewar and I have argued should be removed in Ada 9X. (A >function must contain a return statement RM 6.5(1).) If it belongs on >the top ten list, then the rule should stay. > (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.) How about a rule that requires a function to contain either a return or an explisit raise statement? Would that not satisfy both sides? -- Mark Biggar mab@wdl1.wdl.loral.com