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: 17 Dec 92 14:18:56 GMT From: psinntp!calspan!westley@uunet.uu.net (Terry J. Westley) Subject: Re: Language pitfalls (was Re: FORTRAN bug) Message-ID: <1992Dec17.141856.10631@calspan.com> List-Id: In article eachus@oddjob.mitre.org (Rob ert I. Eachus) writes: > Actually, there is an Ada rule which normally catches this, ["this" refers to substituting "null" for "return null" by mistake] >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.) > >-- > > Robert I. Eachus Many compilers produce a warning for such a situation. IMHO, this is good but doesn't go far enough. I hate compiler warnings; I will typically do anything to eliminate them because I done't want to keep rereading the same warnings every time a unit is compiled. Sometimes, they cannot be eliminated as in the example above. I would like to have the ability, perhaps with a pragma, which allows me to tell the compiler that I know a certain statement will raise a warning of a certain class and to suppress the warning. This must be done on a statement by statement (really warning by warning) basis. Turning off all the warnings is too dangerous. They really are useful. Have any compiler gurus considered this? -- Terry J. Westley, Principal Computer Scientist Calspan Corporation, P.O. Box 400, Buffalo, NY 14225 westley@calspan.com Let's hear it for smart mailers that cut off long signa