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,ab132517972acd5f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news3.google.com!news.glorb.com!news.cs.univ-paris8.fr!newsfeed.vmunix.org!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: accessing record element (question to the pros) Date: Fri, 24 Feb 2006 19:04:55 +0000 Organization: Pushface Message-ID: References: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1140807895 22020 62.49.19.209 (24 Feb 2006 19:04:55 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 24 Feb 2006 19:04:55 +0000 (UTC) Cancel-Lock: sha1:MzF0I6zr1TvTD/3e7FRupXzMjQ0= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:3144 Date: 2006-02-24T19:04:55+00:00 List-Id: "Jeffrey R. Carter" writes: > However, in general, you can't do what you seem to be trying to > do. Variant records do not allow unchecked type conversion; the > language rules prohibit it. That's what Ada.Unchecked_Conversion is > for. GNAT (certainly in recent versions) has pragma Unchecked_Union (http://gcc.gnu.org/onlinedocs/gcc-4.0.2/gnat_rm/Pragma-Unchecked_005fUnion.html#Pragma-Unchecked_005fUnion). NB, compiler-specific.