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
This commit is contained in:
Robert Dewar 2007-06-06 12:49:42 +02:00 committed by Arnaud Charlet
parent c2a49ce627
commit 94a198aa8e
3 changed files with 31 additions and 12 deletions

View File

@ -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;

View File

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

View File

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