diff mbox series

[COMMITTED,04/17] ada: Display actual line length in line length check

Message ID 20240829130750.1651060-4-poulhies@adacore.com
State New
Headers show
Series [COMMITTED,01/17] ada: Update documentation for conditional when constructs | expand

Commit Message

Marc Poulhiès Aug. 29, 2024, 1:07 p.m. UTC
From: Viljar Indus <indus@adacore.com>

gcc/ada/

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

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/styleg.adb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/ada/styleg.adb b/gcc/ada/styleg.adb
index c405dec2b33..74b629c34b3 100644
--- a/gcc/ada/styleg.adb
+++ b/gcc/ada/styleg.adb
@@ -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;