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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,18069d15345a10c8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-13 22:24:55 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!noc.near.net!inmet!dsd!bobduff From: bobduff@dsd.camb.inmet.com (Bob Duff) Subject: Re: Modulus and Remainder operations (Was Re: Help with a bit of C code) Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. References: <1994Oct11.161048.1058@nosc.mil> <37er8t$oh0@watnews1.watson.ibm.com> <1994Oct13.181350.10997@nosc.mil> Date: Thu, 13 Oct 1994 23:44:24 GMT Date: 1994-10-13T23:44:24+00:00 List-Id: In article <1994Oct13.181350.10997@nosc.mil>, Charles H. Sampson wrote: > ...Does anyone know why programs that rely on an implementation >of a compiler-dependent feature were not also classified as erroneous? > > Charlie Depending on an implementation-dependent feature makes your program nonportable. Erroneous execution is much worse: your program might do anything, including delete all the files on your disk, crash the system, and set your keyboard on fire. Therefore, erroneousness is reserved for situations where we really can't predict what might happen. (A good operating system will minimize the probability of trashing the disk, but I know of case where an erroneous Ada program running under MS-DOS actually destroyed the root directory.) In Ada 9X, we have reduced the number of erroneous situations. For example, in Ada 83, reading an uninitialized variable was considered erroneous. In Ada 9X, this is defined as a "Bounded Error", which is not quite as bad as being erroneous, since you have *some* knowledge of what the program might do. Either way, you shouldn't read an uninitialized variable. But if you do (presumably by accident), then in Ada 9X, the damage is a bit less -- it can't trash your disk, for example. In general, "not portable" is not considered to be an error, and certainly should not always be classified as "erroneous". - Bob -- Bob Duff bobduff@inmet.com Oak Tree Software, Inc. Ada 9X Mapping/Revision Team (Intermetrics, Inc.)