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=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!aioe.org!6MpDoNrA+2KoZyE4OD7oYg.user.46.165.242.75.POSTED!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Safe to ignore warnings about function mistaken as primitive? Date: Sun, 10 Jul 2022 21:27:16 -0700 Organization: Aioe.org NNTP Server Message-ID: <864jzoclzv.fsf@stephe-leake.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: gioia.aioe.org; logging-data="44424"; posting-host="6MpDoNrA+2KoZyE4OD7oYg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:/YWa0qUC2WEiv9LLwaJjMQlrDwQ= Xref: reader01.eternal-september.org comp.lang.ada:64091 List-Id: "G.B." writes: > 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? It's best to never ignore warnings, but instead fix them. Even if the only way to "fix" it is to add "pragma Warnings (Off ...)"; that at least tells the reader you have considered the warning. Since B.F is declared in a sibling package, it cannot a primitive of A.Some_Tagged, so the error message is wrong. Since A.Some_Tagged is an interface, you can only declare abstract primitive subprograms for it. So I suspect GNAT knows there's an error, but is giving a confusing error message. How are you intending F to be different from FC? -- -- Stephe