diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-12-28 15:33:08 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-05-04 05:17:29 -0400 |
commit | b65d9aff59bdaa77578de0666077fdf671a020bc (patch) | |
tree | a5a24f0395b1d0e2d13e1c7e9f76bab98514ca3c | |
parent | 6d326562ff4d6ee583123b24acf662a576ac54f6 (diff) | |
download | gcc-b65d9aff59bdaa77578de0666077fdf671a020bc.zip gcc-b65d9aff59bdaa77578de0666077fdf671a020bc.tar.gz gcc-b65d9aff59bdaa77578de0666077fdf671a020bc.tar.bz2 |
[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.
-rw-r--r-- | gcc/ada/errout.adb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 2c05052..3541a77 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; |