From 4641426688cb151187dc9f0e125d52559eccfa85 Mon Sep 17 00:00:00 2001 From: Vincent Celier Date: Thu, 4 Aug 2011 09:46:11 +0000 Subject: [PATCH] a-tags.adb (Check_TSD): Avoid concatenation of strings, as it is not allowed in no run time mode. 2011-08-04 Vincent Celier * a-tags.adb (Check_TSD): Avoid concatenation of strings, as it is not allowed in no run time mode. 2011-08-04 Vincent Celier * make.adb (Check): When -gnatc is used, check for the source file inside the ALI file with a canonical case file name. From-SVN: r177346 --- gcc/ada/ChangeLog | 10 ++++++++++ gcc/ada/a-tags.adb | 14 +++++++++++++- gcc/ada/make.adb | 6 +++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d8a2abe..3ce6f2c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2011-08-04 Vincent Celier + + * a-tags.adb (Check_TSD): Avoid concatenation of strings, as it is not + allowed in no run time mode. + +2011-08-04 Vincent Celier + + * 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 * g-comlin.adb, g-comlin.ads (Add_Switch): Put back support for diff --git a/gcc/ada/a-tags.adb b/gcc/ada/a-tags.adb index 7070fa7..d347307 100644 --- a/gcc/ada/a-tags.adb +++ b/gcc/ada/a-tags.adb @@ -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; diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 29a5d4c..7ae52f1 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -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 -- 2.7.4