From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ac8:5d0c:: with SMTP id f12mr12792049qtx.192.1610734545199; Fri, 15 Jan 2021 10:15:45 -0800 (PST) X-Received: by 2002:a25:42c4:: with SMTP id p187mr19416369yba.504.1610734545060; Fri, 15 Jan 2021 10:15:45 -0800 (PST) Path: eternal-september.org!reader02.eternal-september.org!feeder1.feed.usenet.farm!feed.usenet.farm!news.uzoreto.com!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 15 Jan 2021 10:15:44 -0800 (PST) In-Reply-To: <60014950$0$24269$426a74cc@news.free.fr> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=146.5.2.231; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.231 References: <5ff9779d$0$24281$426a74cc@news.free.fr> <5ffb311f$0$16185$426a74cc@news.free.fr> <5ffb7135$0$24247$426a74cc@news.free.fr> <5ffc8efd$0$8957$426a74cc@news.free.fr> <60004212$0$13563$426a34cc@news.free.fr> <1064b0e8-2486-42be-a52d-1b3bc0bfd65en@googlegroups.com> <60014950$0$24269$426a74cc@news.free.fr> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9f669e87-b60d-4a9c-8aa9-51aa4042533an@googlegroups.com> Subject: Re: Record initialisation question From: Shark8 Injection-Date: Fri, 15 Jan 2021 18:15:45 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:61146 List-Id: On Friday, January 15, 2021 at 12:50:41 AM UTC-7, DrPi wrote: > Unchecked_Conversion is not compatible with no elaboration code. I find that surprising. Ada.Unchecked_Conversion is defined by the LRM as a compiler-intrinsic, with the Pure pragma*: generic type Source(<>) is limited private; type Target(<>) is limited private; function Ada.Unchecked_Conversion(S : Source) return Target with Convention => Intrinsic; pragma Pure(Ada.Unchecked_Conversion); The GNAT source has, as its last three lines: pragma No_Elaboration_Code_All (Ada.Unchecked_Conversion); pragma Pure (Ada.Unchecked_Conversion); pragma Import (Intrinsic, Ada.Unchecked_Conversion); So, if you are generating elaboration-code, then GNAT is broken. * IIUC, this (Intrinsic+Pure) should make it essentially equivalent to C's bitwise reinterpretation-cast, and [IIRC] should qualify for 'static function call'.