From 1b88c61e3749d8da905af1c8efc11002b01bd339 Mon Sep 17 00:00:00 2001 From: Ghjuvan Lacambre Date: Fri, 29 Apr 2022 16:53:05 +0200 Subject: [PATCH] [Ada] Fix spurious options being inserted in -fdiagnostics-format=json output Without this patch, gnat would use `-gnatw?` as the default option for some of the default warnings. gcc/ada/ * erroutc.adb (Get_Warning_Option): Don't consider `?` as a valid option switch. --- gcc/ada/erroutc.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb index b4f50649602..cab7fecef5e 100644 --- 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 -- 2.47.2