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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,442eb9212004f30,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!26g2000hsk.googlegroups.com!not-for-mail From: jujosei@googlemail.com Newsgroups: comp.lang.ada Subject: Problem using Ada.Text_IO.Modular_IO Date: Wed, 9 Jul 2008 09:52:29 -0700 (PDT) Organization: http://groups.google.com Message-ID: <4eab7055-df3d-4d56-87da-8248829da1da@26g2000hsk.googlegroups.com> NNTP-Posting-Host: 141.54.138.140 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1215622350 13546 127.0.0.1 (9 Jul 2008 16:52:30 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 9 Jul 2008 16:52:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 26g2000hsk.googlegroups.com; posting-host=141.54.138.140; posting-account=dETwSAoAAAD4NxjMOBddsi-x6ff1r0M6 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9) Gecko/2008061004 Firefox/3.0,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:1050 Date: 2008-07-09T09:52:29-07:00 List-Id: Dear All, I'm tying to print variables of a defined modular type to the standard io and a file. The type I'm working with is: type Unsigned is mod 2**64; Therefore I define a modular_io package to do this: package mio is new ada.text_io.modular_io(usigned); However, when compile my little test program (using gnatmake -gnato), the compiler tells me that a "Constraint Error" will be raised at runtime. So I tried it with only 63 bit (mod 2**63), which works fine with the GNAT 4.3.1 (20080420) on a 32bit Ubuntu-Linux machine. ----------- test program ----------- with ada.text_io; use ada.text_io; procedure test is type Unsigned is mod 2**64; package M_IO is new Ada.Text_IO.Modular_IO (Unsigned); u : Unsigned := -1; begin m_io.put(Item => u, Width => 20, Base => 16); end; ----------------------------------------- I guess that this is a bug. However, what can I do instead of this, to get 64 bit words printed as hex, octal and binary? Thanks in advance! Cheers Julian Seifert