[Ada] Annotate Ada.Synchronous_Barriers with SPARK_Mode => Off

Message ID 20200609081006.GA73758@adacore.com
State New
Headers show
Series
  • [Ada] Annotate Ada.Synchronous_Barriers with SPARK_Mode => Off
Related show

Commit Message

Pierre-Marie de Rodat June 9, 2020, 8:10 a.m.
Synchronous barriers are currently not supported by GNATprove (i.e. it
doesn't recognize that they are initialized by synchronous). They are
specifically detected and rejected as not-in-SPARK, but it is more
elegant to annotate the Ada.Synchronous runtime library unit with
SPARK_Mode => Off.

Compilation is not affected by this annotation.

Tested on x86_64-pc-linux-gnu, committed on trunk

2020-06-09  Piotr Trojanek  <trojanek@adacore.com>

gcc/ada/

	* libgnarl/a-synbar.ads, libgnarl/a-synbar.adb,
	libgnarl/a-synbar__posix.ads, libgnarl/a-synbar__posix.adb
	(Ada.Synchronous_Barriers): Annotate with SPARK_Mode => Off.

Patch

--- gcc/ada/libgnarl/a-synbar.adb
+++ gcc/ada/libgnarl/a-synbar.adb
@@ -33,7 +33,7 @@ 
 --                                                                          --
 ------------------------------------------------------------------------------
 
-package body Ada.Synchronous_Barriers is
+package body Ada.Synchronous_Barriers with SPARK_Mode => Off is
 
    protected body Synchronous_Barrier is
 

--- gcc/ada/libgnarl/a-synbar.ads
+++ gcc/ada/libgnarl/a-synbar.ads
@@ -33,7 +33,7 @@ 
 --                                                                          --
 ------------------------------------------------------------------------------
 
-package Ada.Synchronous_Barriers is
+package Ada.Synchronous_Barriers with SPARK_Mode => Off is
    pragma Preelaborate (Synchronous_Barriers);
 
    subtype Barrier_Limit is Positive range 1 .. Positive'Last;

--- gcc/ada/libgnarl/a-synbar__posix.adb
+++ gcc/ada/libgnarl/a-synbar__posix.adb
@@ -37,7 +37,7 @@ 
 
 with Interfaces.C; use Interfaces.C;
 
-package body Ada.Synchronous_Barriers is
+package body Ada.Synchronous_Barriers with SPARK_Mode => Off is
 
    --------------------
    -- POSIX barriers --

--- gcc/ada/libgnarl/a-synbar__posix.ads
+++ gcc/ada/libgnarl/a-synbar__posix.ads
@@ -39,7 +39,7 @@  with System;
 private with Ada.Finalization;
 private with Interfaces.C;
 
-package Ada.Synchronous_Barriers is
+package Ada.Synchronous_Barriers with SPARK_Mode => Off is
    pragma Preelaborate (Synchronous_Barriers);
 
    subtype Barrier_Limit is Positive range 1 .. Positive'Last;