aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2007-06-06 12:49:42 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-06-06 12:49:42 +0200
commit94a198aa8e1912693dd8999d298865db6d4971ce (patch)
treec2ec4cdeaf3fc8092e453c3306491d7cc670b4e1 /gcc
parentc2a49ce6276acab7961cc99b9692f77181721ecd (diff)
downloadgcc-94a198aa8e1912693dd8999d298865db6d4971ce.zip
gcc-94a198aa8e1912693dd8999d298865db6d4971ce.tar.gz
gcc-94a198aa8e1912693dd8999d298865db6d4971ce.tar.bz2
stylesw.ads, [...] (Set_GNAT_Style_Check): New procedure
2007-04-20 Robert Dewar <dewar@adacore.com> * stylesw.ads, stylesw.adb (Set_GNAT_Style_Check): New procedure (Set_Style_Check_Options): Recognize new -gnatyg style switch * switch-c.adb (Scan_Front_End_Switches, case -gnatg): Set Warn_On_Non_Local_Exception to False, to turn off warnings for No_Exception_Propagation in ZFP runtime. (Scan_Front_End_Switches): Fix handling of --RTS switch for non GCC back-ends. (Scan_Front_End_Switches): For 'g', call Set_GNAT_Style_Checks From-SVN: r125469
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/stylesw.adb19
-rw-r--r--gcc/ada/stylesw.ads4
-rw-r--r--gcc/ada/switch-c.adb20
3 files changed, 31 insertions, 12 deletions
diff --git a/gcc/ada/stylesw.adb b/gcc/ada/stylesw.adb
index b27d4e0..08a2ef7 100644
--- a/gcc/ada/stylesw.adb
+++ b/gcc/ada/stylesw.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, 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- --
@@ -160,6 +160,16 @@ package body Stylesw is
Set_Style_Check_Options ("3aAbcefhiklmnprst");
end Set_Default_Style_Check_Options;
+ ----------------------------------
+ -- Set_GNAT_Style_Check_Options --
+ ----------------------------------
+
+ procedure Set_GNAT_Style_Check_Options is
+ begin
+ Reset_Style_Check_Options;
+ Set_Style_Check_Options ("3aAbcdefhiklmnprstux");
+ end Set_GNAT_Style_Check_Options;
+
-----------------------------
-- Set_Style_Check_Options --
-----------------------------
@@ -250,6 +260,9 @@ package body Stylesw is
when 'f' =>
Style_Check_Form_Feeds := True;
+ when 'g' =>
+ Set_GNAT_Style_Check_Options;
+
when 'h' =>
Style_Check_Horizontal_Tabs := True;
@@ -360,8 +373,8 @@ package body Stylesw is
when others =>
Err_Col := Err_Col - 1;
- Style_Msg_Buf (1 .. 21) := "invalid style switch:";
- Style_Msg_Len := 22;
+ Style_Msg_Buf (1 .. 22) := "invalid style switch: ";
+ Style_Msg_Len := 23;
Style_Msg_Buf (Style_Msg_Len) := C;
OK := False;
return;
diff --git a/gcc/ada/stylesw.ads b/gcc/ada/stylesw.ads
index 85b8230..284b59d 100644
--- a/gcc/ada/stylesw.ads
+++ b/gcc/ada/stylesw.ads
@@ -264,6 +264,10 @@ package Stylesw is
-- This procedure is called to set the default style checking options
-- in response to a -gnaty switch with no suboptions.
+ procedure Set_GNAT_Style_Check_Options;
+ -- This procedure is called to set the default style checking options
+ -- for GNAT units (as set by -gnatg or -gnatyg).
+
Style_Msg_Buf : String (1 .. 80);
Style_Msg_Len : Natural;
-- Used to return
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb
index fbc0e8f..57fd313 100644
--- a/gcc/ada/switch-c.adb
+++ b/gcc/ada/switch-c.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2007, 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- --
@@ -33,7 +33,7 @@ with Validsw; use Validsw;
with Sem_Warn; use Sem_Warn;
with Stylesw; use Stylesw;
-with GNAT.OS_Lib; use GNAT.OS_Lib;
+with System.OS_Lib; use System.OS_Lib;
with System.WCh_Con; use System.WCh_Con;
@@ -110,11 +110,13 @@ package body Switch.C is
Add_Src_Search_Dir (Switch_Chars (Ptr .. Max));
end if;
- -- Processing of the --RTS switch. --RTS has been modified by
- -- gcc and is now of the form -fRTS.
+ -- Processing of the --RTS switch. --RTS may have been modified by
+ -- gcc into -fRTS (for GCC targets).
elsif Ptr + 3 <= Max
- and then Switch_Chars (Ptr .. Ptr + 3) = "fRTS"
+ and then (Switch_Chars (Ptr .. Ptr + 3) = "fRTS"
+ or else
+ Switch_Chars (Ptr .. Ptr + 3) = "-RTS")
then
Ptr := Ptr + 1;
@@ -127,8 +129,7 @@ package body Switch.C is
-- it is not the first time, the same path has been specified.
if RTS_Specified = null then
- RTS_Specified :=
- new String'(Switch_Chars (Ptr + 4 .. Max));
+ RTS_Specified := new String'(Switch_Chars (Ptr + 4 .. Max));
elsif
RTS_Specified.all /= Switch_Chars (Ptr + 4 .. Max)
@@ -469,7 +470,7 @@ package body Switch.C is
Ada_Version := Ada_05;
Ada_Version_Explicit := Ada_Version;
- -- Set default warnings for -gnatg (same set as -gnatwa)
+ -- Set default warnings for -gnatg
Check_Unreferenced := True;
Check_Unreferenced_Formals := True;
@@ -483,12 +484,13 @@ package body Switch.C is
Warn_On_Export_Import := True;
Warn_On_Modified_Unread := True;
Warn_On_No_Value_Assigned := True;
+ Warn_On_Non_Local_Exception := False;
Warn_On_Obsolescent_Feature := True;
Warn_On_Redundant_Constructs := True;
Warn_On_Unchecked_Conversion := True;
Warn_On_Unrecognized_Pragma := True;
- Set_Style_Check_Options ("3aAbcdefhiklmnprstux");
+ Set_GNAT_Style_Check_Options;
-- Processing for G switch