comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Safe to ignore warnings about function mistaken as primitive?
Date: Sun, 10 Jul 2022 21:27:16 -0700	[thread overview]
Message-ID: <864jzoclzv.fsf@stephe-leake.org> (raw)
In-Reply-To: tae3j4$1b95n$1@dont-email.me

"G.B." <bauhaus@notmyhomepage.invalid> 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

  parent reply	other threads:[~2022-07-11  4:27 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
2022-07-11  4:27 ` Stephen Leake [this message]
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