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>
* makeutl.adb, makeutl.ads, prj-proc.adb, prj.adb, prj.ads: Minor
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -29,6 +29,8 @@
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit;
with Ada.Unchecked_Deallocation;
with System.OS_Lib; use System.OS_Lib;
......
......@@ -36,6 +36,8 @@
-- 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.
pragma Compiler_Unit;
with System.Strings;
package Ada.Command_Line.Response_File is
......
......@@ -33,6 +33,8 @@
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit;
package Ada.Command_Line is
pragma Preelaborate;
......
......@@ -13,6 +13,8 @@
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit;
package Ada.IO_Exceptions is
pragma Pure;
......
......@@ -13,6 +13,8 @@
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit;
with Ada.Containers;
function Ada.Strings.Hash (Key : String) return Containers.Hash_Type;
......
......@@ -2535,6 +2535,8 @@ package body Freeze is
and then not Has_Warnings_Off (F_Type)
and then not Has_Warnings_Off (Formal)
then
-- Qualify mention of formals with subprogram name
Error_Msg_Qual_Level := 1;
-- Check suspicious use of fat C pointer
......@@ -2543,8 +2545,8 @@ package body Freeze is
and then Esize (F_Type) > Ttypes.System_Address_Size
then
Error_Msg_N
("?type of & does not correspond "
& "to C pointer!", Formal);
("?type of & does not correspond to C pointer!",
Formal);
-- Check suspicious return of boolean
......@@ -2554,8 +2556,10 @@ package body Freeze is
and then not Has_Size_Clause (F_Type)
then
Error_Msg_N
("?& is an 8-bit Ada Boolean, "
& "use char in C!", Formal);
("& is an 8-bit Ada Boolean?", Formal);
Error_Msg_N
("\use appropriate corresponding type in C "
& "(e.g. char)?", Formal);
-- Check suspicious tagged type
......@@ -2584,6 +2588,8 @@ package body Freeze is
Formal, F_Type);
end if;
-- Turn off name qualification after message output
Error_Msg_Qual_Level := 0;
end if;
......@@ -2680,9 +2686,17 @@ package body Freeze is
and then not Has_Warnings_Off (R_Type)
and then not Has_Size_Clause (R_Type)
then
Error_Msg_N
("?return type of & is an 8-bit "
& "Ada Boolean, use char in C!", E);
declare
N : constant Node_Id :=
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
......
......@@ -6,7 +6,7 @@
-- --
-- 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 --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -34,7 +34,9 @@
-- 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
-- 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
end GNAT.HTable;
......@@ -112,6 +112,7 @@ Implementation Defined Pragmas
* Pragma Common_Object::
* Pragma Compile_Time_Error::
* Pragma Compile_Time_Warning::
* Pragma Compiler_Unit::
* Pragma Complete_Representation::
* Pragma Complex_Representation::
* Pragma Component_Alignment::
......@@ -722,6 +723,7 @@ consideration, the use of these pragmas should be minimized.
* Pragma Common_Object::
* Pragma Compile_Time_Error::
* Pragma Compile_Time_Warning::
* Pragma Compiler_Unit::
* Pragma Complete_Representation::
* Pragma Complex_Representation::
* Pragma Component_Alignment::
......@@ -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,
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
@unnumberedsec Pragma Complete_Representation
@findex Complete_Representation
......
......@@ -29,6 +29,8 @@
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit;
with System; use System;
with System.Unsigned_Types; use System.Unsigned_Types;
......
......@@ -102,7 +102,7 @@ package body System.OS_Interface is
Res :=
mprotect
(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 Hide_Unhide_Yellow_Zone;
......
......@@ -31,6 +31,8 @@
-- This is the default (used on all native platforms) version of this package
pragma Compiler_Unit;
package body System.Parameters is
-------------------------
......
......@@ -46,6 +46,8 @@
-- Note: do not introduce any pragma Inline statements into this unit, since
-- otherwise the relinking and rebinding capability would be deactivated.
pragma Compiler_Unit;
package System.Parameters is
pragma Pure;
......
......@@ -29,6 +29,8 @@
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit;
package body System.Restrictions is
use Rident;
......
......@@ -38,6 +38,8 @@
-- with names discarded, so that we do not have image tables for the
-- large restriction enumeration types at run time.
pragma Compiler_Unit;
with System.Rident;
package System.Restrictions is
......
......@@ -29,6 +29,8 @@
-- --
------------------------------------------------------------------------------
pragma Compiler_Unit;
package body System.String_Hash is
-- Compute a hash value for a key. The approach here is follows the
......
......@@ -246,7 +246,7 @@ package body System.Task_Primitives.Operations is
Res :=
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);
end if;
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