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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ba0587ecc5989bed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-27 14:49:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!ihug.co.nz!news-xfer.siscom.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Another problem with stream reading. From: Dan Andreatta References: <3CA0B5C4.2060804@home.com> Message-ID: User-Agent: Xnews/4.11.09 X-Original-NNTP-Posting-Host: 129.252.151.109 Date: 27 Mar 2002 15:50:12 -0700 X-Original-Trace: 27 Mar 2002 15:50:12 -0700, 129.252.151.109 X-COMPLAINTS: Report abuse to abuse@mhogaming.com Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com NNTP-Posting-Date: 27 Mar 2002 22:49:30 GMT NNTP-Posting-Host: dfa5ddf8.news.newshosting.com X-Trace: DXC=VOSiR4jmH2[164Qi>j]_h^X`1N4>^k1LSiF6BbIV4YYR:3QCT_6VF\QN3Ef9OZ]@7UM;lF[5C2PfXo5dZhTdOGR]oh3?Aa9Y?3R X-Complaints-To: abuse@newshosting.com Xref: archiver1.google.com comp.lang.ada:21733 Date: 2002-03-27T22:49:30+00:00 List-Id: Erik Sigra wrote in news:mailman.1017244142.7106.comp.lang.ada@ada.eu.org: > tisdagen den 26 mars 2002 18.54 skrev du: >> Just shooting from the hip here, I think the problem is that >> you gave the compiler an impossible assignment. By that, I >> mean that you've declared type Byte to have integer range >> 0..255 and at the same time said its size has to be 8 bits. >> There is no room for that range and a sign bit (since it is >> integer here) to exist in 8 bits (you need 9). As a result >> of lying to HAL, HAL decided to disregard your statement "for >> Byte'Size use 8" and used 16 instead. > > If you look carefully at my code you can se that i did NOT write > "Integer range", just "range". And there is certainly no need for a > sign bit for the range 0 .. 255. If I lie to the compiler, it does > certainly not disregard it. It complais loudly. If I for example say > "for Byte'Size use 7;", it replies "size for "Byte" too small, minimum > allowed is 8" > You are right. If you try with Sequential_IO, everything works perfectly. I don't know why, but the size of the base type for your definition of byte is 16. I did some tests too, and I found: type Byte is range 0..255 'Size => 8 'Base'Size => 16 type Byte is range -128..127 'Size => 8 'Base'Size => 8 type Byte is mod 256 'Size => 8 'Base'Size => 8 (all with "for Byte'Size use 8 ;" ) Why this happen? I don't know! Dan