From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Safe to ignore warnings about function mistaken as primitive?
Date: Sun, 10 Jul 2022 12:19:11 +0200 [thread overview]
Message-ID: <tae92v$ucm$1@gioia.aioe.org> (raw)
In-Reply-To: tae3j4$1b95n$1@dont-email.me
On 2022-07-10 10:45, G.B. wrote:
> 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"
Some_Tagged is an interface, it cannot have implementations anyway.
Should be an error rather than just warning to me.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2022-07-10 10:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-10 8:45 Safe to ignore warnings about function mistaken as primitive? G.B.
2022-07-10 10:19 ` Dmitry A. Kazakov [this message]
2022-07-11 4:27 ` Stephen Leake
2022-07-11 13:17 ` G.B.
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox