diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-09-10 11:57:37 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2010-09-10 11:57:37 +0200 |
commit | 46256d9dd0d03ebd269643039e986c54c6b1e910 (patch) | |
tree | c4b0656553329eed6d33379035b426abfcd5d89c /gcc | |
parent | e976a775e259c5a85907a4b4e9a2b707c7ce9cca (diff) | |
download | gcc-46256d9dd0d03ebd269643039e986c54c6b1e910.zip gcc-46256d9dd0d03ebd269643039e986c54c6b1e910.tar.gz gcc-46256d9dd0d03ebd269643039e986c54c6b1e910.tar.bz2 |
[multiple changes]
2010-09-10 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Add section on intent of style checking options.
2010-09-10 Arnaud Charlet <charlet@adacore.com>
* xref_lib.adb (Get_Full_Type): Fix handling of 'a' char.
2010-09-10 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb: Improve error message on derivation from class-wide type
2010-09-10 Steve Baird <baird@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Enable Expression_With_Actions
generation when Generate_SCIL is True.
2010-09-10 Geert Bosch <bosch@adacore.com>
* gnatlink.adb (Check_ Existing_Executable): New procedure for checking
validity of executable name and removing any existing executable
(Gnatlink): Call Check_Existing_Executable.
From-SVN: r164154
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 23 | ||||
-rw-r--r-- | gcc/ada/gnat1drv.adb | 5 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 11 | ||||
-rw-r--r-- | gcc/ada/gnatlink.adb | 43 | ||||
-rw-r--r-- | gcc/ada/sem_ch3.adb | 14 | ||||
-rw-r--r-- | gcc/ada/xref_lib.adb | 2 |
6 files changed, 80 insertions, 18 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 72a5d2a..13d2030 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,26 @@ +2010-09-10 Robert Dewar <dewar@adacore.com> + + * gnat_ugn.texi: Add section on intent of style checking options. + +2010-09-10 Arnaud Charlet <charlet@adacore.com> + + * xref_lib.adb (Get_Full_Type): Fix handling of 'a' char. + +2010-09-10 Ed Schonberg <schonberg@adacore.com> + + * sem_ch3.adb: Improve error message on derivation from class-wide type + +2010-09-10 Steve Baird <baird@adacore.com> + + * gnat1drv.adb (Adjust_Global_Switches): Enable Expression_With_Actions + generation when Generate_SCIL is True. + +2010-09-10 Geert Bosch <bosch@adacore.com> + + * gnatlink.adb (Check_ Existing_Executable): New procedure for checking + validity of executable name and removing any existing executable + (Gnatlink): Call Check_Existing_Executable. + 2010-09-10 Arnaud Charlet <charlet@adacore.com> * s-tporft.adb, s-taskin.ads (Register_Foreign_Thread): Move diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb index 5def2eb..7a72e19 100644 --- a/gcc/ada/gnat1drv.adb +++ b/gcc/ada/gnat1drv.adb @@ -355,11 +355,6 @@ procedure Gnat1drv is elsif Debug_Flag_Dot_YY then Use_Expression_With_Actions := False; - -- If no debug flags, usage off for SCIL - - elsif Generate_SCIL then - Use_Expression_With_Actions := False; - -- Otherwise this feature is implemented, so we allow its use else diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index a8b3b5b..2f58df1 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -6144,6 +6144,17 @@ specified style check, an appropriate message is given, preceded by the character sequence ``(style)''. This message does not prevent successful compilation (unless the @option{-gnatwe} switch is used). +Note that this is by no means intended to be a general facility for +checking arbitrary coding standards. It is simply an embedding of the +style rules we have chosen for the GNAT sources. If you are starting +a project which does not have established style standards, you may +find it useful to adopt the entire set of GNAT coding standards, or +some subset of them. If you already have an established set of coding +standards, then it may be that selected style checking options do +indeed correspond to choices you have made, but for general checking +of an existing set of coding rules, you should look to the gnatcheck +tool, which is designed for that purpose. + @ifset vms @code{(option,option,@dots{})} is a sequence of keywords @end ifset diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb index 191021d..3cf65eb 100644 --- a/gcc/ada/gnatlink.adb +++ b/gcc/ada/gnatlink.adb @@ -199,6 +199,13 @@ procedure Gnatlink is function Base_Name (File_Name : String) return String; -- Return just the file name part without the extension (if present) + procedure Check_Existing_Executable (File_Name : String); + -- Delete any existing executable to avoid accidentally updating + -- the target of a symbolic link, but produce a Fatail_Error if + -- File_Name matches any of the source file names. This avoids + -- overwriting of extensionless source files by accident on systems + -- where executables do not have extensions. + procedure Delete (Name : String); -- Wrapper to unlink as status is ignored by this application @@ -258,6 +265,31 @@ procedure Gnatlink is return File_Name (Findex1 .. Findex2 - 1); end Base_Name; + ------------------------------- + -- Check_Existing_Executable -- + ------------------------------- + + procedure Check_Existing_Executable (File_Name : String) is + Ename : String := File_Name; + Efile : File_Name_Type; + Sfile : File_Name_Type; + begin + Canonical_Case_File_Name (Ename); + Name_Len := 0; + Add_Str_To_Name_Buffer (Ename); + Efile := Name_Find; + + for J in Units.Table'First .. Units.Last loop + Sfile := Units.Table (J).Sfile; + if Sfile = Efile then + Exit_With_Error ("executable name """ & File_Name & """ matches " + & "source file name """ & Get_Name_String (Sfile) & """"); + end if; + end loop; + + Delete (File_Name); + end Check_Existing_Executable; + ------------ -- Delete -- ------------ @@ -1759,16 +1791,7 @@ begin new String'(Output_File_Name.all); end if; - -- Delete existing executable, in case it is a symbolic link, to avoid - -- modifying the target of the symbolic link. - - declare - Dummy : Boolean; - pragma Unreferenced (Dummy); - - begin - Delete_File (Output_File_Name.all, Dummy); - end; + Check_Existing_Executable (Output_File_Name.all); -- Warn if main program is called "test", as that may be a built-in command -- on Unix. On non-Unix systems executables have a suffix, so the warning diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index c926e09..c39e939 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -13520,8 +13520,18 @@ package body Sem_Ch3 is if not Is_Generic_Actual_Type (Parent_Type) or else In_Visible_Part (Scope (Parent_Type)) then - Error_Msg_N - ("type derived from tagged type must have extension", Indic); + if Is_Class_Wide_Type (Parent_Type) then + Error_Msg_N + ("parent type must not be a class-wide type", Indic); + + -- Use specific type to prevent cascaded errors. + + Parent_Type := Etype (Parent_Type); + + else + Error_Msg_N + ("type derived from tagged type must have extension", Indic); + end if; end if; end if; diff --git a/gcc/ada/xref_lib.adb b/gcc/ada/xref_lib.adb index ed21356..5ea51bd 100644 --- a/gcc/ada/xref_lib.adb +++ b/gcc/ada/xref_lib.adb @@ -518,7 +518,7 @@ package body Xref_Lib is when 'T' => return "task type"; when 'W' => return "protected type"; - when 'a' => return "array type"; + when 'a' => return Param_String & "array object"; when 'b' => return Param_String & "boolean object"; when 'c' => return Param_String & "class-wide object"; when 'd' => return Param_String & "decimal object"; |