* [Ada] Fix spurious options being inserted in -fdiagnostics-format=json output
@ 2022-05-30 8:33 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-30 8:33 UTC (permalink / raw)
To: gcc-patches; +Cc: Ghjuvan Lacambre
[-- Attachment #1: Type: text/plain, Size: 245 bytes --]
Without this patch, gnat would use `-gnatw?` as the default option for
some of the default warnings.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* erroutc.adb (Get_Warning_Option): Don't consider `?` as a
valid option switch.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 533 bytes --]
diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb
--- a/gcc/ada/erroutc.adb
+++ b/gcc/ada/erroutc.adb
@@ -367,7 +367,7 @@ package body Erroutc is
Warn : constant Boolean := Errors.Table (Id).Warn;
Warn_Chr : constant String (1 .. 2) := Errors.Table (Id).Warn_Chr;
begin
- if Warn and then Warn_Chr /= " " then
+ if Warn and then Warn_Chr /= " " and then Warn_Chr (1) /= '?' then
if Warn_Chr = "$ " then
return "-gnatel";
elsif Warn_Chr (2) = ' ' then
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-30 8:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 8:33 [Ada] Fix spurious options being inserted in -fdiagnostics-format=json output Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).