From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.4 required=3.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Safe to ignore warnings about function mistaken as primitive? Date: Sun, 10 Jul 2022 10:45:24 +0200 Organization: A noiseless patient Spider Message-ID: Reply-To: nonlegitur@notmyhomepage.de MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 10 Jul 2022 08:45:24 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="17748d9030baab970700b86cc04aab06"; logging-data="1418423"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TGx6WzPYamWe7/4aQZEloaJ+rwJqXnzg=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Cancel-Lock: sha1:PIY2TzrtdkmzJrfHIEgyyBYKYVs= Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:64087 List-Id: GNAT warns about primitive operations appearing too late in the text. In the following example, though, F is not meant to be a primitive operation of A.Some_Tagged, but instead one of type B.Plain. Can I ignore the warning? gcc -gnatl -c rt_warn.ads GNAT 11.2.0 Copyright 1992-2021, Free Software Foundation, Inc. cannot generate code for file rt_warn.ads (package spec) Compiling: rt_warn.ads Source file time stamp: 2022-07-10 08:34:32 Compiled at: 2022-07-10 10:34:39 1. package Rt_Warn is 2. 3. package A is 4. 5. type Some_Tagged is interface; 6. 7. end A; 8. 9. package B is 10. 11. type Plain is private; 12. 13. function F (Param : A.Some_Tagged) return Plain; | >>> warning: declaration of "F" is too late >>> warning: spec should appear immediately after declaration of "Some_Tagged" 14. function FC (Param : A.Some_Tagged'Class) return Plain; 15. private 16. type Plain is record 17. null; 18. end record; 19. end B; 20. 21. end Rt_Warn; 21 lines: No errors, 2 warnings