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,c95a73ec6ed5f174 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Floating point problem Date: 1997/04/02 Message-ID: #1/1 X-Deja-AN: 230129791 References: <199703271518_MC2-1360-15BE@compuserve.com> <1997Mar28.095005.1@eisner> <333E18D8.1F84@bix.com> <1997Mar30.113716.1@eisner> <1997Apr1.151216.1@eisner> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-04-02T00:00:00+00:00 List-Id: <> There are operating systems for some machines that will attempt to start up arbitrary binary files. So by your peculiar reasoning: (a) All compiler writers for all machines must know about that case (b) They must put in defences against the program starting up in this case dubious I think .... I agree that it would be nice if there were a check for no fpt processor. But it is of an importance level such that there are so many things ahead of it that unless someone is more interested in doing the work than complaining, it probably will never happen! Actually there is also the point that putting in such a check would reduce current functionality, since right now you CAN run GNAT on a machine with no fpt, if you stay away from real arithmetic. You can use pragma Restrictions (No_Floating_Point) in Ada 95 (it is an annex H feature, of course implemented in GNAT, since we implement all annexes): 1. pragma Restrictions (No_Floating_Point); 2. procedure q is 3. g : float; | >>> violation of restriction "no_floating_point" 4. begin 5. g := 1.0; 1 2 >>> violation of restriction "no_floating_point" >>> violation of restriction "no_floating_point" 6. end q; So in fact you can use GNAT now on such a machine, with the compiler checking for violations of the restriction. The nice feature would be to condition the dynamic check on the presence of floating-point in the program, but that's even more work, and even less likely to get done.