From: Ghjuvan Lacambre Date: Fri, 29 Apr 2022 14:53:05 +0000 (+0200) Subject: [Ada] Fix spurious options being inserted in -fdiagnostics-format=json output X-Git-Tag: basepoints/gcc-14~6355 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b88c61e3749d8da905af1c8efc11002b01bd339;p=thirdparty%2Fgcc.git [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. --- 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