Commit f2282a58 by Arnaud Charlet

[multiple changes]

2010-10-05  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch10.adb (Analyze_Task_Body_Stub): Diagnose duplicate stub for
	task.

2010-10-05  Vincent Celier  <celier@adacore.com>

	* gnatbind.adb: If the main library file is not for a suitable main
	program, change the error message.

2010-10-05  Vincent Celier  <celier@adacore.com>

	* a-direct.ads: Minor spelling error fixes in comments.
	* gnat_rm.texi: Add three entries in "Implementation Defined
	Characteristics" for the interpretations of the Form parameters in
	Ada.Directories.

From-SVN: r164980
parent 3ce5ca75
2010-10-05 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Analyze_Task_Body_Stub): Diagnose duplicate stub for
task.
2010-10-05 Vincent Celier <celier@adacore.com>
* gnatbind.adb: If the main library file is not for a suitable main
program, change the error message.
2010-10-05 Vincent Celier <celier@adacore.com>
* a-direct.ads: Minor spelling error fixes in comments.
* gnat_rm.texi: Add three entries in "Implementation Defined
Characteristics" for the interpretations of the Form parameters in
Ada.Directories.
2010-10-05 Robert Dewar <dewar@adacore.com> 2010-10-05 Robert Dewar <dewar@adacore.com>
* exp_ch3.adb, exp_ch5.adb, exp_disp.adb, exp_dist.adb, gnatlink.adb, * exp_ch3.adb, exp_ch5.adb, exp_disp.adb, exp_dist.adb, gnatlink.adb,
......
...@@ -178,39 +178,56 @@ package Ada.Directories is ...@@ -178,39 +178,56 @@ package Ada.Directories is
-- Source_Name (in the absence of Name_Error). -- Source_Name (in the absence of Name_Error).
-- --
-- Interpretation of the Form parameter: -- Interpretation of the Form parameter:
-- The Form parameter is case-insensitive. --
-- Two fields are recognized in the Form parameter: -- The Form parameter is case-insensitive
-- preserve=<value> --
-- mode=<value> -- Two fields are recognized in the Form parameter:
-- <value> starts immediatey after the character '=' and ends with the -- preserve=<value>
-- character immediatey preceding the next comma (',') or with the last -- mode=<value>
-- character of the parameter. --
-- The only possible values for preserve= are: -- <value> starts immediately after the character '=' and ends with the
-- no_attributes: do not try to preserve any file attributes. This is -- character immediately preceding the next comma (',') or with the
-- the default if no preserve= is found in Form. -- last character of the parameter.
-- all_attributes: try to preserve all file attributes (timestamps, --
-- access rights). -- The allowed values for preserve= are:
-- timestamps: preserve the timestamp of the copied file, but not the --
-- other file attributes. -- no_attributes: Do not try to preserve any file attributes. This
-- The only possible values for mode= are: -- is the default if no preserve= is found in Form.
-- copy: only do the copy if the destination file does not already --
-- exist. If it already exist, Copy_File fails. -- all_attributes: Try to preserve all file attributes (timestamps,
-- overwrite: copy the file in all cases. Overwite an aready existing -- access rights).
-- destination file. --
-- append: append the original file to the destination file. If the -- timestamps: Preserve the timestamp of the copied file, but not
-- destination file does not exist, the destination file is -- the other file attributes.
-- a copy of the source file. --
-- When mode=append, the field preserve=, if it exists, is not --
-- taken into account. -- The allowed values for mode= are:
-- If the Form parameter includes one or both of the fields and the value --
-- or values are incorrect, Copy_file fails with Use_Error. -- copy: Only copy if the destination file does not already
-- Examples of correct Forms: -- exist. If it already exists, Copy_File will fail.
-- Form => "preserve=no_attributes,mode=overwrite" (the default) --
-- Form => "mode=append" -- overwrite: Copy the file in all cases. Overwite an already
-- Form => "mode=copy, preserve=all_attributes" -- existing destination file.
-- Examples of incorrect Forms --
-- Form => "preserve=junk" -- append: Append the original file to the destination file.
-- Form => "mode=internal, preserve=timestamps" -- If the destination file does not exist, the
-- destination file is a copy of the source file.
-- When mode=append, the field preserve=, if it
-- exists, is not taken into account.
--
-- What is the default value for mode=???
--
-- If the Form parameter includes one or both of the fields and the value
-- or values are incorrect, Copy_file fails with Use_Error.
--
-- Examples of correct Forms:
-- Form => "preserve=no_attributes,mode=overwrite" (the default)
-- Form => "mode=append"
-- Form => "mode=copy, preserve=all_attributes"
--
-- Examples of incorrect Forms:
-- Form => "preserve=junk"
-- Form => "mode=internal, preserve=timestamps"
---------------------------------------- ----------------------------------------
-- File and directory name operations -- -- File and directory name operations --
......
...@@ -789,8 +789,20 @@ begin ...@@ -789,8 +789,20 @@ begin
and then ALIs.Table (ALIs.First).Main_Program = None and then ALIs.Table (ALIs.First).Main_Program = None
and then not No_Main_Subprogram and then not No_Main_Subprogram
then then
Error_Msg_File_1 := Main_Lib_File; Get_Name_String
Error_Msg ("{ does not contain a unit that can be a main program"); (Units.Table (ALIs.Table (ALIs.First).First_Unit).Uname);
declare
Unit_Name : String := Name_Buffer (1 .. Name_Len - 2);
begin
To_Mixed (Unit_Name);
Get_Name_String (ALIs.Table (ALIs.First).Sfile);
Add_Str_To_Name_Buffer (":1: ");
Add_Str_To_Name_Buffer (Unit_Name);
Add_Str_To_Name_Buffer (" cannot be used as a main program");
Write_Line (Name_Buffer (1 .. Name_Len));
Errors_Detected := Errors_Detected + 1;
end;
end if; end if;
-- Perform consistency and correctness checks -- Perform consistency and correctness checks
......
...@@ -2272,7 +2272,16 @@ package body Sem_Ch10 is ...@@ -2272,7 +2272,16 @@ package body Sem_Ch10 is
else else
Set_Scope (Defining_Entity (N), Current_Scope); Set_Scope (Defining_Entity (N), Current_Scope);
Generate_Reference (Nam, Defining_Identifier (N), 'b'); Generate_Reference (Nam, Defining_Identifier (N), 'b');
Set_Has_Completion (Etype (Nam));
-- Check for duplicate stub, if so give message and terminate
if Has_Completion (Etype (Nam)) then
Error_Msg_N ("duplicate stub for task", N);
return;
else
Set_Has_Completion (Etype (Nam));
end if;
Analyze_Proper_Body (N, Etype (Nam)); Analyze_Proper_Body (N, Etype (Nam));
-- Set elaboration flag to indicate that entity is callable. This -- Set elaboration flag to indicate that entity is callable. This
......
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