comp.lang.ada
 help / color / mirror / Atom feed
* Re: Static vs dynamic evaluation anomaly?
@ 2007-02-06 20:01 Adam Beneschan
  2007-02-07  6:24 ` AW: " Grein, Christoph (Fa. ESG)
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Beneschan @ 2007-02-06 20:01 UTC (permalink / raw)


On Feb 6, 9:29 am, Matt Jaffe <jaf...@cableone.net> wrote:

> Any further help in explaining these anomalies would be much appreciated.  (It's always possible we've stumbled across a compiler bug; but I am reluctant to come to that conclusion prematurely.)

I'm not so reluctant.  It's a compiler bug.

The following program produces incorrect results on GNAT, or at least
on the version I'm using:

with Ada.Text_IO;
procedure test271 is
    type Six_Bits is mod 2**6;
    package Six_Bit_IO is new Ada.Text_IO.Modular_IO(Six_Bits);
    X : Six_Bits := 31;
begin
    for J in 0..5 loop
        Ada.Text_IO.Put ("When J=" & Integer'image(J));
        Ada.Text_IO.Put (", X*2**J =");
        Six_Bit_IO.Put(X*2**J);
        Ada.Text_IO.New_Line;
    end loop;
end test271;

                      -- Adam




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-07  7:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <AEBEAAA73D5180469E2B3F071A96AC220110A637@sma2901.cr.eurocopter.corp>
2007-02-07  7:22 ` AW: Static vs dynamic evaluation anomaly? Grein, Christoph (Fa. ESG)
2007-02-06 20:01 Adam Beneschan
2007-02-07  6:24 ` AW: " Grein, Christoph (Fa. ESG)
2007-02-07  6:59   ` Stefan Lucks

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