unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40964: emacs ada-mode : wisi fails to compile with recent AdaCore wavefronts
@ 2020-04-29 14:28 Koen Meersman
  2020-05-10 12:21 ` Stephen Leake
  2020-06-07 21:24 ` bug#40964: closed by ada-mode version 7.1.3 Stephen Leake
  0 siblings, 2 replies; 3+ messages in thread
From: Koen Meersman @ 2020-04-29 14:28 UTC (permalink / raw)
  To: 40964, ada-mode-users


[-- 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#40964: emacs ada-mode : wisi fails to compile with recent AdaCore wavefronts
  2020-04-29 14:28 bug#40964: emacs ada-mode : wisi fails to compile with recent AdaCore wavefronts Koen Meersman
@ 2020-05-10 12:21 ` Stephen Leake
  2020-06-07 21:24 ` bug#40964: closed by ada-mode version 7.1.3 Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2020-05-10 12:21 UTC (permalink / raw)
  To: 40964

I've submitted ticket T416-025 (on the Eurocontrol support contract) to
AdaCore to ask about the best solution here; similar code in AdaCore's
implementation of Ada.Containers.Doubly_Linked_List uses
'Unrestricted_Access.

-- 
-- Stephe





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#40964: closed by ada-mode version 7.1.3
  2020-04-29 14:28 bug#40964: emacs ada-mode : wisi fails to compile with recent AdaCore wavefronts Koen Meersman
  2020-05-10 12:21 ` Stephen Leake
@ 2020-06-07 21:24 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2020-06-07 21:24 UTC (permalink / raw)
  To: 40964-close


-- 
-- Stephe





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-07 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-29 14:28 bug#40964: emacs ada-mode : wisi fails to compile with recent AdaCore wavefronts Koen Meersman
2020-05-10 12:21 ` Stephen Leake
2020-06-07 21:24 ` bug#40964: closed by ada-mode version 7.1.3 Stephen Leake

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).