]> gcc.gnu.org Git - gcc.git/commitdiff
gnat_ugn.texi: Document -gnateu switch.
authorRobert Dewar <dewar@adacore.com>
Mon, 14 Oct 2013 13:01:34 +0000 (13:01 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 14 Oct 2013 13:01:34 +0000 (15:01 +0200)
2013-10-14  Robert Dewar  <dewar@adacore.com>

* gnat_ugn.texi: Document -gnateu switch.
* opt.ads (Ignore_Unrecognized_VWY_Switches): New switch.
* stylesw.adb: Ignore unrecognized switch if
Ignore_Unrecognized_VWY_Switches set.
* switch-c.adb: Implement -gnateu (sets
Ignore_Unrecognized_VWY_Switches).
* validsw.adb: Ignore unrecognized switch if
Ignore_Unrecognized_VWY_Switches set.
* warnsw.adb: Ignore unrecognized switch if
Ignore_Unrecognized_VWY_Switches set.

From-SVN: r203536

gcc/ada/ChangeLog
gcc/ada/gnat_ugn.texi
gcc/ada/opt.ads
gcc/ada/stylesw.adb
gcc/ada/switch-c.adb
gcc/ada/validsw.adb
gcc/ada/warnsw.adb

index ab038b7bd2853e2cd635e34719671240b6e4c0c7..16fe13c62430ae329d9a54d996061597590e618c 100644 (file)
@@ -1,3 +1,16 @@
+2013-10-14  Robert Dewar  <dewar@adacore.com>
+
+       * gnat_ugn.texi: Document -gnateu switch.
+       * opt.ads (Ignore_Unrecognized_VWY_Switches): New switch.
+       * stylesw.adb: Ignore unrecognized switch if
+       Ignore_Unrecognized_VWY_Switches set.
+       * switch-c.adb: Implement -gnateu (sets
+       Ignore_Unrecognized_VWY_Switches).
+       * validsw.adb: Ignore unrecognized switch if
+       Ignore_Unrecognized_VWY_Switches set.
+       * warnsw.adb: Ignore unrecognized switch if
+       Ignore_Unrecognized_VWY_Switches set.
+
 2013-10-14  Robert Dewar  <dewar@adacore.com>
 
        * exp_prag.adb, sem_prag.adb, a-exexda.adb, s-vmexta.ads: Minor
index 7374f04f6a49ac12d78fae62ebf46288bb6d59fa..407800290b1b969c9a200557e2e7e9d2b1120823 100644 (file)
@@ -3829,6 +3829,14 @@ Synonym of @option{-fdump-scos}, kept for backards compatibility.
 @cindex @option{-gnatet} (@command{gcc})
 Generate target dependent information.
 
+@item -gnateu
+@cindex @option{-gnateu} (@command{gcc})
+Ignore unrecognized validity, warning, and style switches that
+apppear after this switch is given. This may be useful when
+compiling sources developed on a later version of the compiler
+with an earlier version. Of course the earlier version must
+support this switch.
+
 @item ^-gnateV^/PARAMETER_VALIDITY_CHECK^
 @cindex @option{-gnateV} (@command{gcc})
 Check validity of subprogram parameters.
index 42b136922ed3279da224330d4c21a6a78d9efff3..492d5bc5829cf6d0f5f4eeee5d4b73220013762b 100644 (file)
@@ -719,6 +719,12 @@ package Opt is
    --  Set True to ignore all Style_Checks pragmas. Can be set True by use
    --  of -gnateY.
 
+   Ignore_Unrecognized_VWY_Switches : Boolean := False;
+   --  GNAT
+   --  Set True to ignore unrecognized y, V, w switches. Can be set True
+   --  by use of -gnateu, causing subsequent unrecognized switches to result
+   --  in a warning rather than an error.
+
    Implementation_Unit_Warnings : Boolean := True;
    --  GNAT
    --  Set True to active warnings for use of implementation internal units.
index 7b78a1643959cc8371c2a02d73a67130d07b38ba..a708da9e5bc495798ad4125b19b67c155bb97258 100644 (file)
@@ -25,6 +25,7 @@
 
 with Hostparm; use Hostparm;
 with Opt;      use Opt;
+with Output;   use Output;
 
 package body Stylesw is
 
@@ -466,9 +467,13 @@ package body Stylesw is
                null;
 
             when others =>
-               Err_Col := Err_Col - 1;
-               Bad_Style_Switch ("invalid style switch: " & C);
-               return;
+               if Ignore_Unrecognized_VWY_Switches then
+                  Write_Line ("unrecognized switch -gnaty" & C & " ignored");
+               else
+                  Err_Col := Err_Col - 1;
+                  Bad_Style_Switch ("invalid style switch: " & C);
+                  return;
+               end if;
             end case;
 
          --  Turning switches off
@@ -571,9 +576,13 @@ package body Stylesw is
                null;
 
             when others =>
-               Err_Col := Err_Col - 1;
-               Bad_Style_Switch ("invalid style switch: " & C);
-               return;
+               if Ignore_Unrecognized_VWY_Switches then
+                  Write_Line ("unrecognized switch -gnaty-" & C & " ignored");
+               else
+                  Err_Col := Err_Col - 1;
+                  Bad_Style_Switch ("invalid style switch: " & C);
+                  return;
+               end if;
             end case;
          end if;
       end loop;
index 197be06a19ebe70f72f2d339946f0cab4cd2411d..0d80f44a3a55ca16268ab5537ed601d506031c80 100644 (file)
@@ -717,6 +717,12 @@ package body Switch.C is
 
                      return;
 
+                  --  -gnateu (unrecognized y,V,w switches)
+
+                  when 'u' =>
+                     Ptr := Ptr + 1;
+                     Ignore_Unrecognized_VWY_Switches := True;
+
                   --  -gnateV (validity checks on parameters)
 
                   when 'V' =>
index b37825ed46107d44fecc770dda9be0f6c610bbcc..517180ad93694dde6db9280949755e4894ff2270 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2001-2012, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2013, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -23,7 +23,8 @@
 --                                                                          --
 ------------------------------------------------------------------------------
 
-with Opt; use Opt;
+with Opt;    use Opt;
+with Output; use Output;
 
 package body Validsw is
 
@@ -229,9 +230,14 @@ package body Validsw is
                null;
 
             when others =>
-               OK      := False;
-               Err_Col := J - 1;
-               return;
+               if Ignore_Unrecognized_VWY_Switches then
+                  Write_Line ("unrecognized switch -gnatV" & C & " ignored");
+               else
+                  OK      := False;
+                  Err_Col := J - 1;
+                  return;
+               end if;
+
          end case;
       end loop;
 
index 36360f96d6387c50a58a3566b78d7afa253270a4..a957138bdeda8ecd9c301d16163183e042acd6b4 100644 (file)
@@ -25,6 +25,7 @@
 
 with Err_Vars; use Err_Vars;
 with Opt;      use Opt;
+with Output;   use Output;
 
 package body Warnsw is
 
@@ -386,7 +387,11 @@ package body Warnsw is
             No_Warn_On_Non_Local_Exception      := True;
 
          when others =>
-            return False;
+            if Ignore_Unrecognized_VWY_Switches then
+               Write_Line ("unrecognized switch -gnatw." & C & " ignored");
+            else
+               return False;
+            end if;
       end case;
 
       return True;
@@ -672,6 +677,11 @@ package body Warnsw is
             Warn_On_Unchecked_Conversion        := False;
 
          when others =>
+            if Ignore_Unrecognized_VWY_Switches then
+               Write_Line ("unrecognized switch -gnatw" & C & " ignored");
+            else
+               return False;
+            end if;
             return False;
       end case;
 
This page took 0.122926 seconds and 5 git commands to generate.