aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2023-06-30 14:51:53 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-07-18 15:11:46 +0200
commit7e7c40617a6f210b5a4c7cf63970a92bd0b9ec6a (patch)
tree7a0cd1b43486fb7cb4b55da1040597732eef178c
parentf31a63438347c628a64257cb909a400cbd5388e3 (diff)
downloadgcc-7e7c40617a6f210b5a4c7cf63970a92bd0b9ec6a.zip
gcc-7e7c40617a6f210b5a4c7cf63970a92bd0b9ec6a.tar.gz
gcc-7e7c40617a6f210b5a4c7cf63970a92bd0b9ec6a.tar.bz2
ada: Allow warnings with explain code
Change the way explain codes are handled to generate the command for the user to get the explanations, as this was not working for warnings. gcc/ada/ * errout.adb (Error_Msg_Internal): Remove call to Prescan_Message on the special continuation for the explain code command, as this does not play well with the setting of global variables for the message (like its status as a warning or not). Instead, set directly the global variables regarding content of the message in terms of special characters.
-rw-r--r--gcc/ada/errout.adb6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index adc2608..ac6491c 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -1451,10 +1451,12 @@ package body Errout is
if Has_Error_Code then
declare
Msg : constant String :=
- "launch ""gnatprove --explain=[]"" for more information";
+ "\launch ""gnatprove --explain=[]"" for more information";
begin
- Prescan_Message (Msg);
+ Has_Double_Exclam := False;
Has_Error_Code := False;
+ Has_Insertion_Line := False;
+
Error_Msg_Internal
(Msg => Msg,
Span => Span,