From b65d9aff59bdaa77578de0666077fdf671a020bc Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Mon, 28 Dec 2020 15:33:08 +0100 Subject: [PATCH] [Ada] Guard against leading and trailing spaces reappearing in errors gcc/ada/ * errout.adb (Error_Msg_Internal): Add assertion to prevent style mistakes reappearing in the future. --- gcc/ada/errout.adb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 2c0505288986..3541a7723305 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -952,6 +952,11 @@ package body Errout is -- Start of processing for Error_Msg_Internal begin + -- Detect common mistake of prefixing or suffing the message with a + -- space character. + + pragma Assert (Msg (Msg'First) /= ' ' and then Msg (Msg'Last) /= ' '); + if Raise_Exception_On_Error /= 0 then raise Error_Msg_Exception; end if; -- 2.47.3