diff options
author | Ghjuvan Lacambre <lacambre@adacore.com> | 2023-05-26 13:26:21 +0200 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-06-20 09:30:49 +0200 |
commit | 3404e481d09d49311ef74a8de15d8a72ed240cce (patch) | |
tree | f184393216374442a759498e78e6bbc2eef5a1b6 /gcc | |
parent | 298a486c58180adddd99c81217b394f7e4d4bd35 (diff) | |
download | gcc-3404e481d09d49311ef74a8de15d8a72ed240cce.zip gcc-3404e481d09d49311ef74a8de15d8a72ed240cce.tar.gz gcc-3404e481d09d49311ef74a8de15d8a72ed240cce.tar.bz2 |
ada: Fix -fdiagnostics-format=json not printing all messages
The previous version of this code stopped printing messages as soon as
it encountered a deleted or continuation message. This was wrong,
continuation and deleted messages can be followed by live messages that
do need to be printed.
gcc/ada/
* errout.adb (Output_Messages): Fix loop termination condition.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/errout.adb | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 1c6222b..6e378a6 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -3062,16 +3062,19 @@ package body Errout is E := Errors.Table (E).Next; - -- Skip deleted messages. - -- Also skip continuation messages, as they have already been - -- printed along the message they're attached to. + while E /= No_Error_Msg loop + + -- Skip deleted messages. + -- Also skip continuation messages, as they have already been + -- printed along the message they're attached to. + + if not Errors.Table (E).Deleted + and then not Errors.Table (E).Msg_Cont + then + Write_Char (','); + Output_JSON_Message (E); + end if; - while E /= No_Error_Msg - and then not Errors.Table (E).Deleted - and then not Errors.Table (E).Msg_Cont - loop - Write_Char (','); - Output_JSON_Message (E); E := Errors.Table (E).Next; end loop; end if; |