Commit b3afa59b by Arnaud Charlet

[multiple changes]

2009-11-30  Arnaud Charlet  <charlet@adacore.com>

	* s-taprop-posix.adb: Fix casing.
	* s-osinte-tru64.adb: Complete previous check-in.

2009-11-30  Robert Dewar  <dewar@adacore.com>

	* gnat_rm.texi: Document pragma Compiler_Unit
	* s-bitops.adb, s-restri.adb, g-htable.adb, s-restri.ads,
	a-comlin.ads, a-strhas.ads, s-strhas.adb, s-parame.adb,
	s-parame.ads, a-clrefi.adb, a-clrefi.ads, a-ioexce.ads: Supply missing
	Compiler_Unit pragmas.
	* freeze.adb (Freeze_Entity): Improve message for 8-bit boolean passed
	to C.

From-SVN: r154784
parent c8c41617
2009-11-30 Arnaud Charlet <charlet@adacore.com>
* s-taprop-posix.adb: Fix casing.
* s-osinte-tru64.adb: Complete previous check-in.
2009-11-30 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Document pragma Compiler_Unit
* s-bitops.adb, s-restri.adb, g-htable.adb, s-restri.ads,
a-comlin.ads, a-strhas.ads, s-strhas.adb, s-parame.adb,
s-parame.ads, a-clrefi.adb, a-clrefi.ads, a-ioexce.ads: Supply missing
Compiler_Unit pragmas.
* freeze.adb (Freeze_Entity): Improve message for 8-bit boolean passed
to C.
2009-11-30 Robert Dewar <dewar@adacore.com> 2009-11-30 Robert Dewar <dewar@adacore.com>
* makeutl.adb, makeutl.ads, prj-proc.adb, prj.adb, prj.ads: Minor * makeutl.adb, makeutl.ads, prj-proc.adb, prj.adb, prj.ads: Minor
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2009, Free Software Foundation, Inc. -- -- Copyright (C) 2007-2009, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
pragma Compiler_Unit;
with Ada.Unchecked_Deallocation; with Ada.Unchecked_Deallocation;
with System.OS_Lib; use System.OS_Lib; with System.OS_Lib; use System.OS_Lib;
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
-- Using a response file allow passing a set of arguments to an executable -- Using a response file allow passing a set of arguments to an executable
-- longer than the maximum allowed by the system on the command line. -- longer than the maximum allowed by the system on the command line.
pragma Compiler_Unit;
with System.Strings; with System.Strings;
package Ada.Command_Line.Response_File is package Ada.Command_Line.Response_File is
......
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
pragma Compiler_Unit;
package Ada.Command_Line is package Ada.Command_Line is
pragma Preelaborate; pragma Preelaborate;
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
pragma Compiler_Unit;
package Ada.IO_Exceptions is package Ada.IO_Exceptions is
pragma Pure; pragma Pure;
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
pragma Compiler_Unit;
with Ada.Containers; with Ada.Containers;
function Ada.Strings.Hash (Key : String) return Containers.Hash_Type; function Ada.Strings.Hash (Key : String) return Containers.Hash_Type;
......
...@@ -2535,6 +2535,8 @@ package body Freeze is ...@@ -2535,6 +2535,8 @@ package body Freeze is
and then not Has_Warnings_Off (F_Type) and then not Has_Warnings_Off (F_Type)
and then not Has_Warnings_Off (Formal) and then not Has_Warnings_Off (Formal)
then then
-- Qualify mention of formals with subprogram name
Error_Msg_Qual_Level := 1; Error_Msg_Qual_Level := 1;
-- Check suspicious use of fat C pointer -- Check suspicious use of fat C pointer
...@@ -2543,8 +2545,8 @@ package body Freeze is ...@@ -2543,8 +2545,8 @@ package body Freeze is
and then Esize (F_Type) > Ttypes.System_Address_Size and then Esize (F_Type) > Ttypes.System_Address_Size
then then
Error_Msg_N Error_Msg_N
("?type of & does not correspond " ("?type of & does not correspond to C pointer!",
& "to C pointer!", Formal); Formal);
-- Check suspicious return of boolean -- Check suspicious return of boolean
...@@ -2554,8 +2556,10 @@ package body Freeze is ...@@ -2554,8 +2556,10 @@ package body Freeze is
and then not Has_Size_Clause (F_Type) and then not Has_Size_Clause (F_Type)
then then
Error_Msg_N Error_Msg_N
("?& is an 8-bit Ada Boolean, " ("& is an 8-bit Ada Boolean?", Formal);
& "use char in C!", Formal); Error_Msg_N
("\use appropriate corresponding type in C "
& "(e.g. char)?", Formal);
-- Check suspicious tagged type -- Check suspicious tagged type
...@@ -2584,6 +2588,8 @@ package body Freeze is ...@@ -2584,6 +2588,8 @@ package body Freeze is
Formal, F_Type); Formal, F_Type);
end if; end if;
-- Turn off name qualification after message output
Error_Msg_Qual_Level := 0; Error_Msg_Qual_Level := 0;
end if; end if;
...@@ -2680,9 +2686,17 @@ package body Freeze is ...@@ -2680,9 +2686,17 @@ package body Freeze is
and then not Has_Warnings_Off (R_Type) and then not Has_Warnings_Off (R_Type)
and then not Has_Size_Clause (R_Type) and then not Has_Size_Clause (R_Type)
then then
Error_Msg_N declare
("?return type of & is an 8-bit " N : constant Node_Id :=
& "Ada Boolean, use char in C!", E); Result_Definition (Declaration_Node (E));
begin
Error_Msg_NE
("return type of & is an 8-bit Ada Boolean?",
N, E);
Error_Msg_NE
("\use appropriate corresponding type in C "
& "(e.g. char)?", N, E);
end;
-- Check suspicious return tagged type -- Check suspicious return tagged type
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1995-2005, AdaCore -- -- Copyright (C) 1995-2009, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -34,7 +34,9 @@ ...@@ -34,7 +34,9 @@
-- This is a dummy body, required because if we remove the body we have -- This is a dummy body, required because if we remove the body we have
-- bootstrap path problems (this unit used to have a body, and if we do not -- bootstrap path problems (this unit used to have a body, and if we do not
-- supply a dummy body, the old incorrect body is picked up during the -- supply a dummy body, the old incorrect body is picked up during the
-- bootstrap process. -- bootstrap process).
pragma Compiler_Unit;
package body GNAT.HTable is package body GNAT.HTable is
end GNAT.HTable; end GNAT.HTable;
...@@ -112,6 +112,7 @@ Implementation Defined Pragmas ...@@ -112,6 +112,7 @@ Implementation Defined Pragmas
* Pragma Common_Object:: * Pragma Common_Object::
* Pragma Compile_Time_Error:: * Pragma Compile_Time_Error::
* Pragma Compile_Time_Warning:: * Pragma Compile_Time_Warning::
* Pragma Compiler_Unit::
* Pragma Complete_Representation:: * Pragma Complete_Representation::
* Pragma Complex_Representation:: * Pragma Complex_Representation::
* Pragma Component_Alignment:: * Pragma Component_Alignment::
...@@ -722,6 +723,7 @@ consideration, the use of these pragmas should be minimized. ...@@ -722,6 +723,7 @@ consideration, the use of these pragmas should be minimized.
* Pragma Common_Object:: * Pragma Common_Object::
* Pragma Compile_Time_Error:: * Pragma Compile_Time_Error::
* Pragma Compile_Time_Warning:: * Pragma Compile_Time_Warning::
* Pragma Compiler_Unit::
* Pragma Complete_Representation:: * Pragma Complete_Representation::
* Pragma Complex_Representation:: * Pragma Complex_Representation::
* Pragma Component_Alignment:: * Pragma Component_Alignment::
...@@ -1333,6 +1335,24 @@ of formal parameters are tested, and warnings given appropriately. Another use ...@@ -1333,6 +1335,24 @@ of formal parameters are tested, and warnings given appropriately. Another use
with a first parameter of True is to warn a client about use of a package, with a first parameter of True is to warn a client about use of a package,
for example that it is not fully implemented. for example that it is not fully implemented.
@node Pragma Compiler_Unit
@unnumberedsec Pragma Compiler_Unit
@findex Compiler_Unit
@noindent
Syntax:
@smallexample @c ada
pragma Compiler_Unit;
@end smallexample
@noindent
This pragma is intended only for internal use in the GNAT run-time library.
It indicates that the unit is used as part of the compiler build. The effect
is to disallow constructs (raise with message, conditional expressions etc)
that would cause trouble when bootstrapping using an older version of GNAT.
For the exact list of restrictions, see the compiler sources and references
to Is_Compiler_Unit.
@node Pragma Complete_Representation @node Pragma Complete_Representation
@unnumberedsec Pragma Complete_Representation @unnumberedsec Pragma Complete_Representation
@findex Complete_Representation @findex Complete_Representation
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
pragma Compiler_Unit;
with System; use System; with System; use System;
with System.Unsigned_Types; use System.Unsigned_Types; with System.Unsigned_Types; use System.Unsigned_Types;
......
...@@ -102,7 +102,7 @@ package body System.OS_Interface is ...@@ -102,7 +102,7 @@ package body System.OS_Interface is
Res := Res :=
mprotect mprotect
(Teb.all.stack_yellow, Get_Page_Size, (Teb.all.stack_yellow, Get_Page_Size,
prot => (if Res then PROT_ON else PROT_OFF)); prot => (if Hide then PROT_ON else PROT_OFF));
end if; end if;
end Hide_Unhide_Yellow_Zone; end Hide_Unhide_Yellow_Zone;
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
-- This is the default (used on all native platforms) version of this package -- This is the default (used on all native platforms) version of this package
pragma Compiler_Unit;
package body System.Parameters is package body System.Parameters is
------------------------- -------------------------
......
...@@ -46,6 +46,8 @@ ...@@ -46,6 +46,8 @@
-- Note: do not introduce any pragma Inline statements into this unit, since -- Note: do not introduce any pragma Inline statements into this unit, since
-- otherwise the relinking and rebinding capability would be deactivated. -- otherwise the relinking and rebinding capability would be deactivated.
pragma Compiler_Unit;
package System.Parameters is package System.Parameters is
pragma Pure; pragma Pure;
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
pragma Compiler_Unit;
package body System.Restrictions is package body System.Restrictions is
use Rident; use Rident;
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
-- with names discarded, so that we do not have image tables for the -- with names discarded, so that we do not have image tables for the
-- large restriction enumeration types at run time. -- large restriction enumeration types at run time.
pragma Compiler_Unit;
with System.Rident; with System.Rident;
package System.Restrictions is package System.Restrictions is
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
pragma Compiler_Unit;
package body System.String_Hash is package body System.String_Hash is
-- Compute a hash value for a key. The approach here is follows the -- Compute a hash value for a key. The approach here is follows the
......
...@@ -246,7 +246,7 @@ package body System.Task_Primitives.Operations is ...@@ -246,7 +246,7 @@ package body System.Task_Primitives.Operations is
Res := Res :=
mprotect (Guard_Page_Address, Get_Page_Size, mprotect (Guard_Page_Address, Get_Page_Size,
prot => (if ON then PROT_ON else PROT_OFF)); prot => (if On then PROT_ON else PROT_OFF));
pragma Assert (Res = 0); pragma Assert (Res = 0);
end if; end if;
end Stack_Guard; end Stack_Guard;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment