diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2018-01-11 08:52:43 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-01-11 08:52:43 +0000 |
commit | 210fef2d1c7b47c0587375d87d4f4a65f28ca57e (patch) | |
tree | 438021dd8743590fef0f8530f4733004adeeef89 /gcc/ada/libgnat | |
parent | 7d1553e2b65506288b554e948856e9330cee3e5f (diff) | |
download | gcc-210fef2d1c7b47c0587375d87d4f4a65f28ca57e.zip gcc-210fef2d1c7b47c0587375d87d4f4a65f28ca57e.tar.gz gcc-210fef2d1c7b47c0587375d87d4f4a65f28ca57e.tar.bz2 |
[Ada] Annotate standard File_Type with Default_Initial_Condition (for SPARK)
GNATprove was emitting spurious checks about objects of the File_Type being
uninitialized and there was no easy to fix that (those checks could only be
silenced by pragma Annotate or by hiding File_Type behind as SPARK wrapper).
Now the full view of File_Type is annotated with Default_Initial_Condition
and GNATprove knows that objects of that type are default-initialized. The
default initialization is implicitly defined in the Ada RM (as indeed
there is no procedure that would take an IN OUT parameter of that type).
Semantics of Ada programs shall not be affected by these annotations,
so no frontend test is provided. It only affects GNATprove.
2018-01-11 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* libgnat/a-direio.ads, libgnat/a-sequio.ads, libgnat/a-ststio.ads,
libgnat/a-textio.ads, libgnat/a-witeio.ads, libgnat/a-ztexio.ads
(File_Type): Add Default_Initial_Condition aspect.
From-SVN: r256502
Diffstat (limited to 'gcc/ada/libgnat')
-rw-r--r-- | gcc/ada/libgnat/a-direio.ads | 2 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-sequio.ads | 2 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-ststio.ads | 2 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-textio.ads | 2 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-witeio.ads | 2 | ||||
-rw-r--r-- | gcc/ada/libgnat/a-ztexio.ads | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/gcc/ada/libgnat/a-direio.ads b/gcc/ada/libgnat/a-direio.ads index 96ed11d..fced84c 100644 --- a/gcc/ada/libgnat/a-direio.ads +++ b/gcc/ada/libgnat/a-direio.ads @@ -50,7 +50,7 @@ package Ada.Direct_IO is (Element_Type'Has_Tagged_Values, "Element_Type for Direct_IO instance has tagged values"); - type File_Type is limited private; + type File_Type is limited private with Default_Initial_Condition; type File_Mode is (In_File, Inout_File, Out_File); diff --git a/gcc/ada/libgnat/a-sequio.ads b/gcc/ada/libgnat/a-sequio.ads index 6d2d568..6877367 100644 --- a/gcc/ada/libgnat/a-sequio.ads +++ b/gcc/ada/libgnat/a-sequio.ads @@ -50,7 +50,7 @@ package Ada.Sequential_IO is (Element_Type'Has_Tagged_Values, "Element_Type for Sequential_IO instance has tagged values"); - type File_Type is limited private; + type File_Type is limited private with Default_Initial_Condition; type File_Mode is (In_File, Out_File, Append_File); diff --git a/gcc/ada/libgnat/a-ststio.ads b/gcc/ada/libgnat/a-ststio.ads index efcb5fc..7349aea 100644 --- a/gcc/ada/libgnat/a-ststio.ads +++ b/gcc/ada/libgnat/a-ststio.ads @@ -41,7 +41,7 @@ package Ada.Streams.Stream_IO is type Stream_Access is access all Root_Stream_Type'Class; - type File_Type is limited private; + type File_Type is limited private with Default_Initial_Condition; type File_Mode is (In_File, Out_File, Append_File); diff --git a/gcc/ada/libgnat/a-textio.ads b/gcc/ada/libgnat/a-textio.ads index 5c85892..33ba5fc 100644 --- a/gcc/ada/libgnat/a-textio.ads +++ b/gcc/ada/libgnat/a-textio.ads @@ -49,7 +49,7 @@ with System.WCh_Con; package Ada.Text_IO is pragma Elaborate_Body; - type File_Type is limited private; + type File_Type is limited private with Default_Initial_Condition; type File_Mode is (In_File, Out_File, Append_File); -- The following representation clause allows the use of unchecked diff --git a/gcc/ada/libgnat/a-witeio.ads b/gcc/ada/libgnat/a-witeio.ads index bbf35eb..578149b 100644 --- a/gcc/ada/libgnat/a-witeio.ads +++ b/gcc/ada/libgnat/a-witeio.ads @@ -51,7 +51,7 @@ with System.WCh_Con; package Ada.Wide_Text_IO is - type File_Type is limited private; + type File_Type is limited private with Default_Initial_Condition; type File_Mode is (In_File, Out_File, Append_File); -- The following representation clause allows the use of unchecked diff --git a/gcc/ada/libgnat/a-ztexio.ads b/gcc/ada/libgnat/a-ztexio.ads index 730fc02..efcd502 100644 --- a/gcc/ada/libgnat/a-ztexio.ads +++ b/gcc/ada/libgnat/a-ztexio.ads @@ -51,7 +51,7 @@ with System.WCh_Con; package Ada.Wide_Wide_Text_IO is - type File_Type is limited private; + type File_Type is limited private with Default_Initial_Condition; type File_Mode is (In_File, Out_File, Append_File); -- The following representation clause allows the use of unchecked |