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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNAT bugs around use of "for X'Address..." clause Date: Fri, 22 May 2015 08:38:35 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="8f3bdf433f184ad9fec01bd73e350c65"; logging-data="5769"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tk7w/3D7ff/45PqRflBGgvxpCs5md5Xw=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:9yJTbbbFDZFaPzi0KVHYO3HiWPo= sha1:vpJE8kZXWukb3jVRkaQ25cf/1k8= Xref: news.eternal-september.org comp.lang.ada:25936 Date: 2015-05-22T08:38:35+01:00 List-Id: erik.shadwick@gmail.com writes: > Should I be submitting this to AdaCore, or GCC's > http://gcc.gnu.org/bugs.html bug tracker? When running this with my > copy of GNAT free/GPL, it suggests the former, but when compiling it > through ideone.com I get the message to put it into GCC's tracker. It > detects the error in "in gnat_to_gnu_entity, at > ada/gcc-interface/decl.c:347". FSF GCC 4.9.1 raises a bug box (in a different place). 5.1.0 doesn't crash, but says (as I expected) warning: default initialization of "X" may modify overlaid storage warning: use pragma Import for "X" to suppress initialization (RM B.1(24)) (that is, "X : P.Checked_T with Import, Convention => Ada;") Unfortunately, fixing that doesn't make your problem go away. You could wait for GNAT GPL 2015, or you could try the FSF 5.1.0 at [1]. > Further, what is the validity of assigning to a variable that has the > 'Address clause on it -- is it legal and defined behaviour? Yes, but writing to System.Null_Address will probably not produce useful behaviour. What you have here is an interaction between the type invariant and the address setting. [1] https://sourceforge.net/projects/gnuada/files/GNAT_GCC%20Mac%20OS%20X/5.1.0/