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,2aaba1527862ef22 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!news.aset.psu.edu!not-for-mail From: "Bob Spooner" Newsgroups: comp.lang.ada Subject: Re: Reading Float Data from a binary file into ada Date: Thu, 1 Feb 2007 11:05:52 -0500 Organization: Penn State University, Center for Academic Computing Message-ID: References: <1170172307.292500.256090@m58g2000cwm.googlegroups.com> <1170252776.235803.122220@j27g2000cwj.googlegroups.com> <1170268699.548152.214890@q2g2000cwa.googlegroups.com> <45GdnVwAocsGylzYnZ2dnUVZ_oannZ2d@comcast.com> NNTP-Posting-Host: nat4.arl.psu.edu X-Trace: f04n12.cac.psu.edu 1170345965 32524 128.118.40.79 (1 Feb 2007 16:06:05 GMT) X-Complaints-To: usenet@f04n12.cac.psu.edu NNTP-Posting-Date: Thu, 1 Feb 2007 16:06:05 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Response Xref: g2news2.google.com comp.lang.ada:8818 Date: 2007-02-01T11:05:52-05:00 List-Id: "Steve" wrote in message news:45GdnVwAocsGylzYnZ2dnUVZ_oannZ2d@comcast.com... > [snip] Unchecked conversion is the preferred way of copying the memory > image from one value to another that is of a different type. This is the > preferred way to handle what C was doing with a union. > Well, it's the common way to do it, but the C standard doesn't say that you'll get what you expect if you write the data one way and read it another way. Both K & R and the MISRA standard warn about this, but "everybody" seems to rely on it working. Unions were originally created to allow variant records, but I haven't encountered them being used that way in actual code in my admittedly limited experience. Regards, Bob