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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2ceb82769e7e23b X-Google-Attributes: gid103376,public From: Mats Weber Subject: Re: Help needed in port to GNAT95 from verdix Date: 1998/05/14 Message-ID: <355B227D.2858F2BD@elca-matrix.ch>#1/1 X-Deja-AN: 353243014 Content-Transfer-Encoding: 7bit References: <6jcvoc$drd$1@plug.news.pipex.net> Content-Type: text/plain; charset=us-ascii Organization: ELCA Matrix SA Mime-Version: 1.0 Reply-To: Mats.Weber@elca-matrix.ch Newsgroups: comp.lang.ada Date: 1998-05-14T00:00:00+00:00 List-Id: Paul Hussein wrote: > > I do not understand why a piece of code that works on verdix will not now > work an gnat95, and this is an important piece of code. If anyone could help > it would be most appreciated. Because it contains assumptions about the 'Size of Float, and unchecked_conversion to/from an array of floats. Consider yourself lucky if this ports between different versions of the Verdix compiler. > When I run this code sample, and the code itself in our system I get a > constraint error. > This code endeavours to turn any type into an array of floats for passing > over the network. A very bad idea. Not any sequence of bits is a valid float. If you really have to convert to something, then use type Byte is 0 .. 255; for Byte'Size use 8; type Byte_Array is array (Positive range <>) of Byte; pragma Pack(Byte_Array); where any sequence of bits is a valid value.