comp.lang.ada
 help / color / mirror / Atom feed
* Ada compiler fixed point bug
@ 1996-06-18  0:00 Marc A. Criley
  0 siblings, 0 replies; only message in thread
From: Marc A. Criley @ 1996-06-18  0:00 UTC (permalink / raw)



I recently located what I believe is a bug in a commercial Ada 83
compiler, but I want to first ensure there's no possible interpretation
of the LRM that could provide a loophole :-)

Here's a test program:

procedure Delta_Test is

   Tiny_Delta : constant := 2.0**(-19);

   type Fxd is delta Tiny_Delta range -0.625..0.625;
   for Fxd'Size use 16;  -- This should be too little.

   type R is record
      F : Fxd;
   end record;

   for R use record at mod 2;
      F at 0 range 0..15;  -- And so should this.
   end record;

   X : R;

begin
   null;
end Delta_Test;

The compiler in question happily compiles the above code with
nary an error or warning, while two other compilers (three if
you count GNAT in 83 mode) properly flag that the size of Fxd
is too small (GNAT tells me 20 bits are needed, which is what
I expected).  This compiler does ostensibly have thorough support
for all Chapter 13 constructs, so I would expect some sort of
error or warning.  Is there possibly some loophole that would
result in this being a legal compilation?

Thanks much!

Marc A. Criley

OOA = (Re)packaging, OOA /= Decomposition




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-06-18  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-18  0:00 Ada compiler fixed point bug Marc A. Criley

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