comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Floating point problem
Date: 1997/04/02
Date: 1997-04-02T00:00:00+00:00	[thread overview]
Message-ID: <dewar.859986420@merv> (raw)
In-Reply-To: 1997Apr1.151216.1@eisner


<<If there is an operating system which will start up the program on
the "wrong" chip, yes.>>

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.





  parent reply	other threads:[~1997-04-02  0:00 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-27  0:00 Floating point problem Kees de Lezenne Coulande
1997-03-28  0:00 ` Robert Dewar
1997-03-28  0:00   ` Larry Kilgallen
1997-03-28  0:00     ` Tom Moran
1997-03-28  0:00     ` Robert Dewar
1997-03-29  0:00       ` Tom Moran
1997-03-30  0:00         ` Larry Kilgallen
1997-03-31  0:00           ` Robert Dewar
1997-04-01  0:00             ` Larry Kilgallen
1997-04-01  0:00               ` Tom Moran
1997-04-02  0:00                 ` Larry Kilgallen
1997-04-02  0:00                   ` Robert Dewar
1997-04-03  0:00                     ` Jerry van Dijk
1997-04-03  0:00                       ` Jerry van Dijk
1997-04-03  0:00                         ` Jerry van Dijk
1997-04-02  0:00               ` Robert Dewar [this message]
1997-03-31  0:00         ` Robert Dewar
1997-03-31  0:00           ` Tom Moran
1997-03-31  0:00             ` Robert Dewar
1997-03-28  0:00 ` J-P. Rosen
1997-03-28  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-02-26  0:00 floating " bill
1997-03-02  0:00 ` Corbin Dunn
1997-03-02  0:00   ` tmel
1997-03-02  0:00     ` Robert Dewar
1997-03-03  0:00 ` Kenneth W. Sodemann
1997-03-04  0:00   ` Robert Dewar
1997-03-05  0:00     ` Larry Kilgallen
1997-03-05  0:00       ` Robert Dewar
1997-03-06  0:00         ` Larry Kilgallen
1997-03-09  0:00           ` Robert Dewar
1997-03-10  0:00             ` Fergus Henderson
1997-03-10  0:00               ` Robert Dewar
1997-03-10  0:00                 ` Larry Kilgallen
1997-03-12  0:00                   ` Robert Dewar
1997-03-12  0:00                     ` Joel VanLaven
1997-03-12  0:00                       ` Robert Dewar
1997-03-12  0:00                     ` Larry Kilgallen
1997-03-13  0:00                       ` Robert Dewar
1997-03-14  0:00                         ` Larry Kilgallen
1997-03-15  0:00                           ` Robert Dewar
1997-03-13  0:00                     ` Kenneth W. Sodemann
1997-03-15  0:00                       ` Robert Dewar
1997-03-16  0:00                         ` Larry Kilgallen
1997-03-06  0:00     ` Geert Bosch
1997-03-06  0:00       ` Fergus Henderson
1997-03-06  0:00         ` Scott Ingram
1997-03-06  0:00       ` Robert Dewar
1997-03-17  0:00   ` Tom Moran
1997-03-17  0:00   ` Robert I. Eachus
1997-03-17  0:00     ` Robert Dewar
1997-03-18  0:00   ` Robert I. Eachus
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox