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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cef1e23795181e0c X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Alternate to Unchecked_Conversion - Portable? Date: 1999/02/21 Message-ID: #1/1 X-Deja-AN: 446852901 Sender: matt@mheaney.ni.net References: <36d05e39.0@news.pacifier.com> NNTP-Posting-Date: Sun, 21 Feb 1999 14:39:03 PDT Newsgroups: comp.lang.ada Date: 1999-02-21T00:00:00+00:00 List-Id: "Steve Doiel" writes: > I discovered a technique for performing a similar function to > Unchecked_Conversion. Locating two data structures at the same address by > defining the first normally and then using an address clause to locate the > second at the same address as the first (as shown in the following sample): > My question is: is this portable? > > I expect that record layouts will be dependent on different endian machines, > and I know that this technique is inherently unsafe, but it makes things > very simple. Don't use address overlays unless you have a compelling reason to do so. Use Unchecked_Conversion, which is also "very simple."