[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
This commit is contained in:
Arnaud Charlet 2015-11-18 11:12:27 +01:00
parent 1d74252db8
commit 5a99fda7cc
4 changed files with 30 additions and 4 deletions

View file

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

View file

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

View file

@ -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;

View file

@ -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;