comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Problem with emacs ada-mode-7.1.4
Date: Mon, 19 Jul 2021 14:17:44 -0700	[thread overview]
Message-ID: <868s22atqf.fsf@stephe-leake.org> (raw)
In-Reply-To: ly7dhny4ig.fsf@pushface.org

Simon Wright <simon@pushface.org> writes:

> Paul Onions <ponions37@gmail.com> writes:
>
>> I have one question: was my original problem a bug in the ada-mode
>> code or is it a bug in the latest GNAT compiler?  (GCC 11.1.0)
>
> Just had a poke around.
>
> GNAT CE 2019, using the matching gnatcoll-db and gnatcoll-bindings from
> the CE download site, worked OK.
>
> CE 2020, with its matching bindings, required the WORKAROUND changes to
> build.
>
> CE 2021, with its matching bindings, failed in *exactly the same way* as
> FSF GCC 11.1.0!! There was an interesting thread about this at [1]; I'm
> not sure from that whether the ada-mode code is OK or not, but it seems
> that even if it is we'll have to wait for a later compiler release.

I think the latest gnat compiler is more correct, so the bug is in the
ada-mode code. There is a fix in the devel version of ada-mode (it still
has workarounds for a remaining compiler bug I found while creating that
fix). 

I think you can access that devel version of ada-mode via the "bleeding
edge" elpa repository, which serves the HEAD versions instead of the
release versions. But I can't find any instructions on how to do that in
the ELPA docs.

> The lesson I'd draw is that building your own container collection is
> risky. 

More generally, trusting the compiler to check use of access types, by
never using 'Unchecked_Access.

> At least if you start from Ada.Containers you have a reasonably firm
> basis.

I question "firm"; they use 'Unchecked_Access internally, and they are
not written in Spark. The best you can say is "maintained by AdaCore",
which nominally means any bugs exposed by compiler updates are fixed
before the compiler updates are released.

I posit that I have more experience writing Ada code than many of the
people now at AdaCore :).

Some of the containers in ada-mode that are required to be fast (because
they are used a lot in error recovery) are written in Spark; they use
bounded data storage, not allocation. Some are not, because they require
allocation. Spark has lately added some support for allocation; I'll
have to check if that means I can now migrate those containers to Spark.

> With regard to "matching bindings" above, these can be found at the CE
> download site[2]. 

As you point out, that has gnatcoll-bindings, but not gnatcoll-db;
gnatcoll-db is only available via github. ada-mode.info currently says
to get gnatcoll-bindings from github; I'll change that.

A recent exchange with AdaCore indicated that packages on github are
_not_ supported (even with a support contract). Which I did not know
before, and is yet another reason to switch to libadalang (which is
supported).

-- 
-- Stephe

  parent reply	other threads:[~2021-07-19 21:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-17  7:56 Problem with emacs ada-mode-7.1.4 Paul Onions
2021-07-17 21:18 ` Simon Wright
2021-07-18  8:43   ` Paul Onions
2021-07-18  9:00     ` Dmitry A. Kazakov
2021-07-18  9:26       ` Paul Onions
2021-07-18 13:28         ` Paul Onions
2021-07-18 16:24           ` Simon Wright
2021-07-18 19:24             ` Paul Onions
2021-07-19 11:14               ` Simon Wright
2021-07-19 21:17             ` Stephen Leake [this message]
2021-07-19 20:57         ` Stephen Leake
2021-07-18 17:03 ` Stephen Leake
2021-07-18 19:36   ` Paul Onions
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox