From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7a83623780b9aa09 X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Are there any automatic tools to convert ada83 source into ada95? Date: 1998/12/30 Message-ID: #1/1 X-Deja-AN: 427161575 Sender: bobduff@world.std.com (Robert A Duff) References: <766l70$dh1$1@nnrp1.dejanews.com> <87vhiv3m7j.fsf@mihalis.ix.netcom.com> <769fl1$mcr$1@nnrp1.dejanews.com> <87n247z2yk.fsf@mihalis.ix.netcom.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1998-12-30T00:00:00+00:00 List-Id: Chris Morgan writes: > robert_dewar@my-dejanews.com writes: > > To be clear on this point, this was highly dubious code > > in Ada 83, since Ada 83 compilers were allowed to raise > > Constraint_Error instead of Numeric_Error in any situation. > > Right, but ours didn't. To clarify Robert's point: there are many situations in Ada 83 where something can raise either Constraint_Error or Numeric_Error. It's not that some compilers might be sloppy, and fail to distinguish two different situations. It's that the different situations are genuinely indistinguishable. You gave one example: > Yep, you guessed it, someone did an abs() of -32768 type T is range -32768..-32767; X: T := -32768; ... X := abs(X); According to the Ada 83 RM, the above statement might raise either C_E or P_E. Any code that tries to distinguish the two is, as Robert said, "dubious". In Ada 95, it raises C_E (and P_E is just a renaming of C_E). A good style in Ada 83 was to always pair the two: "when C_E | P_E => ...". The Ada 95 rules are carefully crafted to make that idiom still be legal. - Bob -- Change robert to bob to get my real email address. Sorry.