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 X-Google-Thread: 103376,ba0587ecc5989bed X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-25 14:36:47 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Another problem with stream reading. X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=iso-8859-1 Message-ID: <3C9FA2C4.684A3FBE@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 8bit Organization: The Boeing Company X-Accept-Language: en References: Mime-Version: 1.0 Date: Mon, 25 Mar 2002 22:20:52 GMT X-Mailer: Mozilla 4.73 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.google.com comp.lang.ada:21659 Date: 2002-03-25T22:20:52+00:00 List-Id: Erik Sigra wrote: > > m�ndagen den 25 mars 2002 20.01 skrev du: > > Erik Sigra wrote in > > > > news:mailman.1017082205.9199.comp.lang.ada@ada.eu.org: > > > procedure Streamtest is > > > The_File : Stream_IO.File_Type; > > > begin > > > Open (The_File, In_File, "data"); > > > declare > > > The_Stream : Stream_Access := Stream (The_File); > > > type Byte is range 0 .. 255; > > > for Byte'Size use 8; > > > B : Byte; > > > begin > > > while not End_Of_File (The_File) loop > > > Byte'Read (The_Stream, B); > > > Put_Line ("Read B = " & B'Img); > > > end loop; > > > end; > > > end Streamtest; > > > > Don't know exactly why, but is you modify: > > > > type Byte is mod 256; > > > > it works properly. > > Yes it works here to, thanks! > > Does anyone know what causes this behaviour? Is it specified or should I > report it to the compiler maker? Probably because "range 0 .. 255" gives Byte'Base'Size of 16 and you're running it on a little-endian machine, while "mod 2 ** 8" gives Byte'Base'Size of 8; -- Jeffrey Carter