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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4eca860272d4832b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!q2g2000cwa.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: Static vs dynamic evaluation anomaly? Date: 6 Feb 2007 12:01:17 -0800 Organization: http://groups.google.com Message-ID: <1170792077.235994.10900@q2g2000cwa.googlegroups.com> References: <12shen4qjhv41a7@corp.supernews.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1170792094 31593 127.0.0.1 (6 Feb 2007 20:01:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 6 Feb 2007 20:01:34 +0000 (UTC) In-Reply-To: <12shen4qjhv41a7@corp.supernews.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: q2g2000cwa.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:9036 Date: 2007-02-06T12:01:17-08:00 List-Id: On Feb 6, 9:29 am, Matt Jaffe 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