2011-08-04 Vincent Celier <celier@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Aug 2011 09:46:11 +0000 (09:46 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Aug 2011 09:46:11 +0000 (09:46 +0000)
* a-tags.adb (Check_TSD): Avoid concatenation of strings, as it is not
allowed in no run time mode.

2011-08-04  Vincent Celier  <celier@adacore.com>

* make.adb (Check): When -gnatc is used, check for the source file
inside the ALI file with a canonical case file name.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177346 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/a-tags.adb
gcc/ada/make.adb

index d8a2abe..3ce6f2c 100644 (file)
@@ -1,3 +1,13 @@
+2011-08-04  Vincent Celier  <celier@adacore.com>
+
+       * a-tags.adb (Check_TSD): Avoid concatenation of strings, as it is not
+       allowed in no run time mode.
+
+2011-08-04  Vincent Celier  <celier@adacore.com>
+
+       * make.adb (Check): When -gnatc is used, check for the source file
+       inside the ALI file with a canonical case file name.
+
 2011-08-04  Emmanuel Briot  <briot@adacore.com>
 
        * g-comlin.adb, g-comlin.ads (Add_Switch): Put back support for
index 7070fa7..d347307 100644 (file)
@@ -315,6 +315,8 @@ package body Ada.Tags is
       for E_Tag'Address use TSD.External_Tag.all'Address;
       pragma Import (Ada, E_Tag);
 
+      Dup_Ext_Tag : constant String := "duplicated external tag """;
+
    --  Start of processing for Check_TSD
 
    begin
@@ -324,7 +326,17 @@ package body Ada.Tags is
       T := External_Tag_HTable.Get (To_Address (TSD.External_Tag));
 
       if T /= null then
-         raise Program_Error with "duplicated external tag " & E_Tag;
+         --  Avoid concatenation, as it is not allowed in no run time mode
+
+         declare
+            Msg : String (1 .. Dup_Ext_Tag'Length + E_Tag_Len + 1);
+         begin
+            Msg (1 .. Dup_Ext_Tag'Length) := Dup_Ext_Tag;
+            Msg (Dup_Ext_Tag'Length + 1 .. Dup_Ext_Tag'Length + E_Tag_Len) :=
+              E_Tag;
+            Msg (Msg'Last) := '"';
+            raise Program_Error with Msg;
+         end;
       end if;
    end Check_TSD;
 
index 29a5d4c..7ae52f1 100644 (file)
@@ -1622,10 +1622,14 @@ package body Make is
 
          if Operating_Mode = Check_Semantics then
             declare
-               File_Name : constant String := Get_Name_String (Source_File);
+               File_Name : String := Get_Name_String (Source_File);
                OK        : Boolean := False;
 
             begin
+               --  In the ALI file, the source file names are in canonical case
+
+               Canonical_Case_File_Name (File_Name);
+
                for U in ALIs.Table (ALI).First_Unit ..
                  ALIs.Table (ALI).Last_Unit
                loop