aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-11-18 11:12:27 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2015-11-18 11:12:27 +0100
commit5a99fda7cc9576f48f3eafbc00ed349bbb2d178d (patch)
tree6d41381f164cbe24eaa8b98d2936c684de19b473 /gcc/ada
parent1d74252db852527360f1357ed06d573d47122e24 (diff)
downloadgcc-5a99fda7cc9576f48f3eafbc00ed349bbb2d178d.zip
gcc-5a99fda7cc9576f48f3eafbc00ed349bbb2d178d.tar.gz
gcc-5a99fda7cc9576f48f3eafbc00ed349bbb2d178d.tar.bz2
[multiple changes]
2015-11-18 Arnaud Charlet <charlet@adacore.com> * interfac.ads (Unsigned_24): New type. * sem_ch13.adb (Validate_Unchecked_Conversion): Disable error on unconstrained arrays in Relaxed_RM_Semantics mode. 2015-11-18 Vincent Celier <celier@adacore.com> * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking): No warning is withed unit is the interface of a Stand-Alone Library. From-SVN: r230527
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/bcheck.adb8
-rw-r--r--gcc/ada/interfac.ads7
-rw-r--r--gcc/ada/sem_ch13.adb8
4 files changed, 30 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 39e407b..d462f2f0 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2015-11-18 Arnaud Charlet <charlet@adacore.com>
+
+ * interfac.ads (Unsigned_24): New type.
+ * sem_ch13.adb (Validate_Unchecked_Conversion): Disable error on
+ unconstrained arrays in Relaxed_RM_Semantics mode.
+
+2015-11-18 Vincent Celier <celier@adacore.com>
+
+ * bcheck.adb (Check_Consistent_Dynamic_Elaboration_Checking): No
+ warning is withed unit is the interface of a Stand-Alone Library.
+
2015-11-18 Thomas Quinot <quinot@adacore.com>
* s-os_lib.ads, s-os_lib.adb(Normalize_Pathname): Support the case of
diff --git a/gcc/ada/bcheck.adb b/gcc/ada/bcheck.adb
index 4170b0e..72a2cbd 100644
--- a/gcc/ada/bcheck.adb
+++ b/gcc/ada/bcheck.adb
@@ -447,12 +447,13 @@ package body Bcheck is
---------------------------------------------------
-- The rule here is that if a unit has dynamic elaboration checks,
- -- then any unit it withs must meeting one of the following criteria:
+ -- then any unit it withs must meet one of the following criteria:
-- 1. There is a pragma Elaborate_All for the with'ed unit
-- 2. The with'ed unit was compiled with dynamic elaboration checks
-- 3. The with'ed unit has pragma Preelaborate or Pure
-- 4. It is an internal GNAT unit (including children of GNAT)
+ -- 5. It is an interface of a Stand-Aline Library
procedure Check_Consistent_Dynamic_Elaboration_Checking is
begin
@@ -496,6 +497,11 @@ package body Bcheck is
elsif Is_Internal_File_Name (WU.Sfile) then
null;
+ -- Case 5. With'ed unit is a SAL interface
+
+ elsif WU.SAL_Interface then
+ null;
+
-- Issue warning, not one of the safe cases
else
diff --git a/gcc/ada/interfac.ads b/gcc/ada/interfac.ads
index 6e3afff..2c501a2 100644
--- a/gcc/ada/interfac.ads
+++ b/gcc/ada/interfac.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2015, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -65,6 +65,11 @@ package Interfaces is
type Unsigned_16 is mod 2 ** 16;
for Unsigned_16'Size use 16;
+ type Unsigned_24 is mod 2 ** 24;
+ for Unsigned_24'Size use 24;
+ -- Declare this type for compatibility with legacy Ada compilers.
+ -- This is particularly useful in the context of CodePeer analysis.
+
type Unsigned_32 is mod 2 ** 32;
for Unsigned_32'Size use 32;
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 56b81b4..d56bd2c 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -13570,9 +13570,13 @@ package body Sem_Ch13 is
Target := Underlying_Type (Target);
end if;
- -- Source may be unconstrained array, but not target
+ -- Source may be unconstrained array, but not target, except in relaxed
+ -- semantics mode.
- if Is_Array_Type (Target) and then not Is_Constrained (Target) then
+ if Is_Array_Type (Target)
+ and then not Is_Constrained (Target)
+ and then not Relaxed_RM_Semantics
+ then
Error_Msg_N
("unchecked conversion to unconstrained array not allowed", N);
return;