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: Preelaboration Date: Mon, 16 May 2016 17:26:58 +0100 Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="df4c32f3bd97eb14b94825e0d909f9c9"; logging-data="6712"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+abPJoZFRuwETA8WHPIxdkQmWYbhnIcVw=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Cancel-Lock: sha1:a5h2PJQQPbuNeKuU8+ZB/FCSwTA= sha1:OgAqxU0wSHTFonrM1KwOFTuaDFo= Xref: news.eternal-september.org comp.lang.ada:30417 Date: 2016-05-16T17:26:58+01:00 List-Id: I (think I) need to eliminate elaboration calls in parts of my Cortex GNAT Runtime Systems project[1], and I'm left with one that I can't understand. (1) what does pragma Preelaborate actually mean? I hoped it would mean "you don't need to elaborate this package". (2) If you give Preelaborate, is it a compiler error to generate elaboration code? (the generated elaboration procedure does nothing). (3) I find ARM 10.2.1(10)[2] unclear (I got here because the problematic package body instantiates a generic). Does it mean that the instantiation won't be preelaborable unless all of 10.1 .. 10.4 are false? Or does it mean that the compiler will make these assumptions regardless of actuals? And, looking at (10.1), would you expect generic type Item is private with Preelaborable_Initialization; package Generic_Queues is to be legal? GNAT rejects it, 'aspect "Preelaborable_Initialization" not allowed for formal type declaration'. [1] https://sourceforge.net/projects/cortex-gnat-rts/ [2] http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-10-2-1.html#p10