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.
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


Reply via email to