aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhjuvan Lacambre <lacambre@adacore.com>2022-04-29 16:53:05 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-30 08:29:05 +0000
commit1b88c61e3749d8da905af1c8efc11002b01bd339 (patch)
tree792c39940fec79c45aa21e50acdc3d9649fde4cb
parenta4db870e1b042ac6ab7ddaef6e2d3e32408578dd (diff)
downloadgcc-1b88c61e3749d8da905af1c8efc11002b01bd339.zip
gcc-1b88c61e3749d8da905af1c8efc11002b01bd339.tar.gz
gcc-1b88c61e3749d8da905af1c8efc11002b01bd339.tar.bz2
[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.
-rw-r--r--gcc/ada/erroutc.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/erroutc.adb b/gcc/ada/erroutc.adb
index b4f5064..cab7fec 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