unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Koen Meersman <koen.meersman@gmail.com>
To: 40964@debbugs.gnu.org, ada-mode-users@nongnu.org
Subject: bug#40964: emacs ada-mode : wisi fails to compile with recent AdaCore wavefronts
Date: Wed, 29 Apr 2020 16:28:45 +0200	[thread overview]
Message-ID: <CADi_At9jSR7-jWJTjJXtKhO+2uRP+uDKK_Ku15n=7eJMOy+ghA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1437 bytes --]

Package: emacs, ada-mode

Hi,

When compiling ada-mode-6.2.1 / wisi-2.2.1 using 'GNAT Pro 21.0w 20200426'
we get following errors:

    wisi.ads:363:04: warning: in instantiation at
sal-gen_unbounded_definite_vectors.adb:448 [enabled by default]
    wisi.ads:363:04: warning: non-local pointer cannot point to local
object [enabled by default]
    wisi.ads:363:04: warning: Program_Error will be raised at run time
[enabled by default]
    wisi.ads:363:04: warning: in instantiation at
sal-gen_unbounded_definite_vectors.adb:504 [enabled by default]
    wisi.ads:363:04: warning: non-local pointer cannot point to local
object [enabled by default]
    wisi.ads:363:04: warning: Program_Error will be raised at run time
[enabled by default]
    sal-gen_unbounded_definite_vectors.adb:448:18: non-local pointer cannot
point to local object
    sal-gen_unbounded_definite_vectors.adb:504:18: non-local pointer cannot
point to local object
    gprbuild: *** compilation phase failed

It looks like wisi violates (according to the new/recent wavefront) some
accessibility rules.
The patch (as attachment) fixes the accessibility errors by modifying
'Access to 'Unrestricted_Access or 'Unchecked_Access.
(This is an ugly hack/patch but I like to show you where the problem is)

Similar problems exist in latest wisi release (3.0.1) and git (
git.savannah.gnu.org/git/emacs/elpa.git)

Can you have a look at the reported errors?

Thanks,

Koen

[-- Attachment #1.2: Type: text/html, Size: 2121 bytes --]

[-- Attachment #2: accessability_checks.patch --]
[-- Type: application/octet-stream, Size: 3381 bytes --]

When compiling Wisi with AdaCore wavefronts 21.0w, we get errors below.  This patch fixes the accessibility erors by
modifying 'Access to 'Unrestricted_Access or 'Unchecked_Access.

    wisi.ads:363:04: warning: in instantiation at sal-gen_unbounded_definite_vectors.adb:448 [enabled by default]
    wisi.ads:363:04: warning: non-local pointer cannot point to local object [enabled by default]
    wisi.ads:363:04: warning: Program_Error will be raised at run time [enabled by default]
    wisi.ads:363:04: warning: in instantiation at sal-gen_unbounded_definite_vectors.adb:504 [enabled by default]
    wisi.ads:363:04: warning: non-local pointer cannot point to local object [enabled by default]
    wisi.ads:363:04: warning: Program_Error will be raised at run time [enabled by default]
    sal-gen_unbounded_definite_vectors.adb:448:18: non-local pointer cannot point to local object
    sal-gen_unbounded_definite_vectors.adb:504:18: non-local pointer cannot point to local object
    gprbuild: *** compilation phase failed

--- sal-gen_unbounded_definite_red_black_trees.adb.orig	2020-04-29 12:48:00.761522830 +0000
+++ sal-gen_unbounded_definite_red_black_trees.adb	2020-04-29 12:50:06.080057764 +0000
@@ -318,7 +318,7 @@
       if Node = null then
          raise Not_Found;
       else
-         return (Element => Node.all.Element'Access, Dummy => 1);
+         return (Element => Node.all.Element'Unrestricted_Access, Dummy => 1);
       end if;
    end Constant_Reference;
 
@@ -342,7 +342,7 @@
       if Node = null then
          raise Not_Found;
       else
-         return (Element => Node.all.Element'Access, Dummy => 1);
+         return (Element => Node.all.Element'Unrestricted_Access, Dummy => 1);
       end if;
    end Variable_Reference;
 
--- sal-gen_unbounded_definite_vectors.adb.orig	2020-04-29 12:50:51.111890648 +0000
+++ sal-gen_unbounded_definite_vectors.adb	2020-04-29 12:51:34.100731114 +0000
@@ -445,7 +445,7 @@
       if Container.First = No_Index then
          return No_Element;
       else
-         return (Container'Access, To_Peek_Type (Container.First));
+         return (Container'Unchecked_Access, To_Peek_Type (Container.First));
       end if;
    end First;
 
@@ -501,7 +501,7 @@
       if Index not in Container.First .. Container.Last then
          return No_Element;
       else
-         return (Container'Access, To_Peek_Type (Index));
+         return (Container'Unchecked_Access, To_Peek_Type (Index));
       end if;
    end To_Cursor;
 
--- wisitoken-parse-lr-parser_lists.adb.orig	2020-04-29 12:51:49.129675340 +0000
+++ wisitoken-parse-lr-parser_lists.adb	2020-04-29 12:52:21.179556401 +0000
@@ -81,7 +81,7 @@
 
    function First (List : aliased in out Parser_Lists.List'Class) return Cursor
    is begin
-      return (Elements => List.Elements'Access, Ptr => List.Elements.First);
+      return (Elements => List.Elements'Unchecked_Access, Ptr => List.Elements.First);
    end First;
 
    procedure Next (Cursor : in out Parser_Lists.Cursor)
@@ -398,7 +398,7 @@
 
    function Iterate (Container : aliased in out List) return Iterator_Interfaces.Forward_Iterator'Class
    is begin
-      return Iterator'(Container => Container'Access);
+      return Iterator'(Container => Container'Unchecked_Access);
    end Iterate;
 
    function Has_Element (Iterator : in Parser_Node_Access) return Boolean

[-- Attachment #3: accessability_checks.patch --]
[-- Type: application/octet-stream, Size: 3381 bytes --]

When compiling Wisi with AdaCore wavefronts 21.0w, we get errors below.  This patch fixes the accessibility erors by
modifying 'Access to 'Unrestricted_Access or 'Unchecked_Access.

    wisi.ads:363:04: warning: in instantiation at sal-gen_unbounded_definite_vectors.adb:448 [enabled by default]
    wisi.ads:363:04: warning: non-local pointer cannot point to local object [enabled by default]
    wisi.ads:363:04: warning: Program_Error will be raised at run time [enabled by default]
    wisi.ads:363:04: warning: in instantiation at sal-gen_unbounded_definite_vectors.adb:504 [enabled by default]
    wisi.ads:363:04: warning: non-local pointer cannot point to local object [enabled by default]
    wisi.ads:363:04: warning: Program_Error will be raised at run time [enabled by default]
    sal-gen_unbounded_definite_vectors.adb:448:18: non-local pointer cannot point to local object
    sal-gen_unbounded_definite_vectors.adb:504:18: non-local pointer cannot point to local object
    gprbuild: *** compilation phase failed

--- sal-gen_unbounded_definite_red_black_trees.adb.orig	2020-04-29 12:48:00.761522830 +0000
+++ sal-gen_unbounded_definite_red_black_trees.adb	2020-04-29 12:50:06.080057764 +0000
@@ -318,7 +318,7 @@
       if Node = null then
          raise Not_Found;
       else
-         return (Element => Node.all.Element'Access, Dummy => 1);
+         return (Element => Node.all.Element'Unrestricted_Access, Dummy => 1);
       end if;
    end Constant_Reference;
 
@@ -342,7 +342,7 @@
       if Node = null then
          raise Not_Found;
       else
-         return (Element => Node.all.Element'Access, Dummy => 1);
+         return (Element => Node.all.Element'Unrestricted_Access, Dummy => 1);
       end if;
    end Variable_Reference;
 
--- sal-gen_unbounded_definite_vectors.adb.orig	2020-04-29 12:50:51.111890648 +0000
+++ sal-gen_unbounded_definite_vectors.adb	2020-04-29 12:51:34.100731114 +0000
@@ -445,7 +445,7 @@
       if Container.First = No_Index then
          return No_Element;
       else
-         return (Container'Access, To_Peek_Type (Container.First));
+         return (Container'Unchecked_Access, To_Peek_Type (Container.First));
       end if;
    end First;
 
@@ -501,7 +501,7 @@
       if Index not in Container.First .. Container.Last then
          return No_Element;
       else
-         return (Container'Access, To_Peek_Type (Index));
+         return (Container'Unchecked_Access, To_Peek_Type (Index));
       end if;
    end To_Cursor;
 
--- wisitoken-parse-lr-parser_lists.adb.orig	2020-04-29 12:51:49.129675340 +0000
+++ wisitoken-parse-lr-parser_lists.adb	2020-04-29 12:52:21.179556401 +0000
@@ -81,7 +81,7 @@
 
    function First (List : aliased in out Parser_Lists.List'Class) return Cursor
    is begin
-      return (Elements => List.Elements'Access, Ptr => List.Elements.First);
+      return (Elements => List.Elements'Unchecked_Access, Ptr => List.Elements.First);
    end First;
 
    procedure Next (Cursor : in out Parser_Lists.Cursor)
@@ -398,7 +398,7 @@
 
    function Iterate (Container : aliased in out List) return Iterator_Interfaces.Forward_Iterator'Class
    is begin
-      return Iterator'(Container => Container'Access);
+      return Iterator'(Container => Container'Unchecked_Access);
    end Iterate;
 
    function Has_Element (Iterator : in Parser_Node_Access) return Boolean

             reply	other threads:[~2020-04-29 14:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 14:28 Koen Meersman [this message]
2020-05-10 12:21 ` bug#40964: emacs ada-mode : wisi fails to compile with recent AdaCore wavefronts Stephen Leake
2020-06-07 21:24 ` bug#40964: closed by ada-mode version 7.1.3 Stephen Leake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADi_At9jSR7-jWJTjJXtKhO+2uRP+uDKK_Ku15n=7eJMOy+ghA@mail.gmail.com' \
    --to=koen.meersman@gmail.com \
    --cc=40964@debbugs.gnu.org \
    --cc=ada-mode-users@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).