]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Replace use of 'Image with use of Error_Msg_Uint
authorGhjuvan Lacambre <lacambre@adacore.com>
Thu, 15 Jul 2021 09:11:00 +0000 (11:11 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 22 Sep 2021 15:01:42 +0000 (15:01 +0000)
gcc/ada/

* sem_case.adb (Composite_Case_Ops): Replace 'Image with
Error_Msg_Uint.

gcc/ada/sem_case.adb

index cc7e988226d0b86d2e8c09b7dea7a23c81010aed..31f14d5353dffff46d35ffabc25e150f098f7507 100644 (file)
@@ -1717,12 +1717,12 @@ package body Sem_Case is
                         and then List_Length (Expressions (Expr))
                            /= Nat (Part_Id'Last)
                      then
+                        Error_Msg_Uint_1 := UI_From_Int
+                          (List_Length (Expressions (Expr)));
+                        Error_Msg_Uint_2 := UI_From_Int (Int (Part_Id'Last));
                         Error_Msg_N
-                          ("Array aggregate length"
-                            & List_Length (Expressions (Expr))'Image
-                            & " does not match length of"
-                            & " statically constrained case selector"
-                            & Part_Id'Last'Image, Expr);
+                          ("array aggregate length ^ does not match length " &
+                           "of statically constrained case selector ^", Expr);
                         return;
                      end if;
 
@@ -1761,12 +1761,13 @@ package body Sem_Case is
                         if not Unconstrained_Array_Case
                            and then Strlen /= Nat (Part_Id'Last)
                         then
+                           Error_Msg_Uint_1 := UI_From_Int (Strlen);
+                           Error_Msg_Uint_2 := UI_From_Int
+                             (Int (Part_Id'Last));
                            Error_Msg_N
-                             ("String literal length"
-                              & Strlen'Image
-                              & " does not match length of"
-                              & " statically constrained case selector"
-                              & Part_Id'Last'Image, Expr);
+                             ("String literal length ^ does not match length" &
+                              " of statically constrained case selector ^",
+                              Expr);
                            return;
                         end if;