public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-929] [Ada] Add contracts to System.Address_To_Access_Conversions
@ 2022-06-02  9:08 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-06-02  9:08 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f03f48a3843046a4ee888db3b86c0efe3812e2c7

commit r13-929-gf03f48a3843046a4ee888db3b86c0efe3812e2c7
Author: Joffrey Huguet <huguet@adacore.com>
Date:   Mon May 9 15:25:30 2022 +0200

    [Ada] Add contracts to System.Address_To_Access_Conversions
    
    This patch adds SPARK annotations to subprograms from
    System.Address_To_Access_Conversions. To_Pointer is considered to have
    no global items, if the returned value has no aliases. To_Address is
    forbidden in SPARK because addresses are not handled.
    
    gcc/ada/
    
            * libgnat/s-atacco.ads (To_Pointer): Add Global => null.
            (To_Address): Add SPARK_Mode => Off.

Diff:
---
 gcc/ada/libgnat/s-atacco.ads | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/ada/libgnat/s-atacco.ads b/gcc/ada/libgnat/s-atacco.ads
index 736210dc98b..b3559ffed79 100644
--- a/gcc/ada/libgnat/s-atacco.ads
+++ b/gcc/ada/libgnat/s-atacco.ads
@@ -54,8 +54,10 @@ package System.Address_To_Access_Conversions is
    --  optimizations that may cause unexpected results based on the assumption
    --  of no strict aliasing.
 
-   function To_Pointer (Value : Address)        return Object_Pointer;
-   function To_Address (Value : Object_Pointer) return Address;
+   function To_Pointer (Value : Address)        return Object_Pointer with
+     Global => null;
+   function To_Address (Value : Object_Pointer) return Address with
+     SPARK_Mode => Off;
 
    pragma Import (Intrinsic, To_Pointer);
    pragma Import (Intrinsic, To_Address);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-02  9:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02  9:08 [gcc r13-929] [Ada] Add contracts to System.Address_To_Access_Conversions Pierre-Marie de Rodat

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