]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Display actual line length in line length check
authorViljar Indus <indus@adacore.com>
Tue, 13 Aug 2024 08:37:31 +0000 (11:37 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 29 Aug 2024 13:06:27 +0000 (15:06 +0200)
gcc/ada/

* styleg.adb (Check_Line_Max_Length): Add the actual line length
to the diagnostic message.

gcc/ada/styleg.adb

index c405dec2b33251266b45d3b4e89b325e0c6344e3..74b629c34b3352b4488e25f27ca644cff6e46069 100644 (file)
@@ -38,6 +38,7 @@ with Sinfo;          use Sinfo;
 with Sinfo.Nodes;    use Sinfo.Nodes;
 with Sinput;         use Sinput;
 with Stylesw;        use Stylesw;
+with Uintp;          use Uintp;
 
 package body Styleg is
 
@@ -672,8 +673,9 @@ package body Styleg is
    begin
       if Style_Check_Max_Line_Length then
          if Len > Style_Max_Line_Length then
+            Error_Msg_Uint_1 := UI_From_Int (Len);
             Error_Msg
-              ("(style) this line is too long?M?",
+              ("(style) this line is too long: ^?M?",
                Current_Line_Start + Source_Ptr (Style_Max_Line_Length));
          end if;
       end if;