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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d23826ff0acb491b,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!h3g2000yqa.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Gem 39 - compiler specific? Date: Wed, 2 Sep 2009 13:38:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9e0bbbcd-260f-48ed-8043-d6280c633e85@h3g2000yqa.googlegroups.com> NNTP-Posting-Host: 85.1.160.71 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1251923960 5927 127.0.0.1 (2 Sep 2009 20:39:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 2 Sep 2009 20:39:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: h3g2000yqa.googlegroups.com; posting-host=85.1.160.71; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8116 Date: 2009-09-02T13:38:52-07:00 List-Id: Consider: http://www.adacore.com/2008/06/09/gem-39/ The example code performs Unchecked_Conversion between addresses of two different array types. As far as I understand, there is no standard provision for arrays to occupy contiguous memory space (and not even for the alignment of their components) and such a conversion relies heavily on the assumption that arrays can be "overlaid" by plain address reinterpretation. Still, this technique is quite attractive. What is the chance (in practice) to hit the compiler that does not get it "right"? -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada