diff options
author | Robert Dewar <dewar@adacore.com> | 2007-08-14 10:39:55 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2007-08-14 10:39:55 +0200 |
commit | c690a2ec7301f5089252456d4fb764787c1a6fdb (patch) | |
tree | 7e41dee7f76f1b53282f8674e6481a3eda46f35d /gcc/ada/switch-c.adb | |
parent | ede007da18026bf6153ce5d86de81e147760b763 (diff) | |
download | gcc-c690a2ec7301f5089252456d4fb764787c1a6fdb.zip gcc-c690a2ec7301f5089252456d4fb764787c1a6fdb.tar.gz gcc-c690a2ec7301f5089252456d4fb764787c1a6fdb.tar.bz2 |
opt.ads: Warning for non-local exception propagation now off by default New switch...
2007-08-14 Robert Dewar <dewar@adacore.com>
Ed Schonberg <schonberg@adacore.com>
* opt.ads: Warning for non-local exception propagation now off by
default
New switch -gnatI to disable representation clauses
Implement new pragma Implicit_Packing
* usage.adb:
Warning for non-local exception propagation now off by default
Add warning for unchecked conversion of pointers wi different
conventions.
New switch -gnatI to disable representation clauses
* usage.adb: new switch -gnatyS
* gnat_ugn.texi: For the gnatcheck Non_Qualified_Aggregates rule add a
note that aggregates of anonymous array types are not flagged.
-gnatwc now includes membership tests optimized away
-gnatw.x warnings are now off by default
Added conditional compilation Appendix
Add documentation of -gnatI
Add documentation for new -gnatyS style check
Update documentation about SAL and auto-init on Windows.
* gnat_rm.texi:
Add documentation for pragma Check_Name and 'Enabled attribute
Document that Eliminate on dispatching operation is ignored
Document IDE attributes VCS_Repository_Root and VCS_Patch_Root.
Document pragma Main
Document pragma Implicit_Packing
* sem_ch13.adb: Add warning for unchecked conversion of pointers wi
different conventions
New switch -gnatI to disable representation clauses
* switch-c.adb (Scan_Front_End_Switches): When a -gnat switch is not
recognized, report the invalid characters including "-gnat" instead of
just the first character in the switch.
New switch -gnatI to disable representation clauses
Set Warn_On_Object_Renames_Function true for -gnatg
* vms_data.ads: Add doc for /IGNORE_REP_CLAUSES
Add STATEMENTS_AFTER_THEN_ELSE as synonym for -gnatyS
Add qualifier /ADD_PROJECT_SEARCH_DIR= for different tools, equivalent
to switch -aP (add directory to project search dir).
* par-prag.adb: Implement new pragma Implicit_Packing
* sem_prag.adb (Analyze_Pragma, case Complex_Representation): Mark the
type as having a non-standard representation, to force expansion on
conversion to related types.
(Analyze_Pragma): Warn on misspelled pragma
(Analyze_Pragma, case Convention_Identifier): Fix checking of second arg
Ensure consistent use of # in error messages
Implement pragma Implicit_Packing
From-SVN: r127421
Diffstat (limited to 'gcc/ada/switch-c.adb')
-rw-r--r-- | gcc/ada/switch-c.adb | 95 |
1 files changed, 52 insertions, 43 deletions
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb index 57fd313..1a6a28d 100644 --- a/gcc/ada/switch-c.adb +++ b/gcc/ada/switch-c.adb @@ -178,7 +178,7 @@ package body Switch.C is -- There are no other switches not starting with -gnat else - Bad_Switch (C); + Bad_Switch (Switch_Chars); end if; -- Case of switch starting with -gnat @@ -260,8 +260,10 @@ package body Switch.C is elsif C = '.' then Dot := True; + elsif Dot then + Bad_Switch ("-gnatd." & Switch_Chars (Ptr .. Max)); else - Bad_Switch (C); + Bad_Switch ("-gnatd" & Switch_Chars (Ptr .. Max)); end if; end loop; @@ -289,7 +291,7 @@ package body Switch.C is -- so we must always have a character after the e. if Ptr > Max then - Bad_Switch (C); + Bad_Switch ("-gnate"); end if; case Switch_Chars (Ptr) is @@ -308,7 +310,7 @@ package body Switch.C is end if; if Ptr > Max then - Bad_Switch (C); + Bad_Switch ("-gnatec"); end if; declare @@ -351,7 +353,7 @@ package body Switch.C is Ptr := Ptr + 1; if Ptr > Max then - Bad_Switch (C); + Bad_Switch ("-gnateD"); end if; Add_Symbol_Definition (Switch_Chars (Ptr .. Max)); @@ -390,7 +392,7 @@ package body Switch.C is end if; if Ptr > Max then - Bad_Switch (C); + Bad_Switch ("-gnatem"); end if; Mapping_File_Name := @@ -411,7 +413,7 @@ package body Switch.C is end if; if Ptr > Max then - Bad_Switch (C); + Bad_Switch ("-gnatep"); end if; Preprocessing_Data_File := @@ -432,7 +434,7 @@ package body Switch.C is -- All other -gnate? switches are unassigned when others => - Bad_Switch (C); + Bad_Switch ("-gnate" & Switch_Chars (Ptr .. Max)); end case; -- -gnatE (dynamic elaboration checks) @@ -472,23 +474,24 @@ package body Switch.C is -- Set default warnings for -gnatg - Check_Unreferenced := True; - Check_Unreferenced_Formals := True; - Check_Withs := True; - Constant_Condition_Warnings := True; - Implementation_Unit_Warnings := True; - Ineffective_Inline_Warnings := True; - Warn_On_Assumed_Low_Bound := True; - Warn_On_Bad_Fixed_Value := True; - Warn_On_Constant := True; - 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; + Check_Unreferenced := True; + Check_Unreferenced_Formals := True; + Check_Withs := True; + Constant_Condition_Warnings := True; + Implementation_Unit_Warnings := True; + Ineffective_Inline_Warnings := True; + Warn_On_Assumed_Low_Bound := True; + Warn_On_Bad_Fixed_Value := True; + Warn_On_Constant := True; + 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_Object_Renames_Function := True; + Warn_On_Unchecked_Conversion := True; + Warn_On_Unrecognized_Pragma := True; Set_GNAT_Style_Check_Options; @@ -514,7 +517,7 @@ package body Switch.C is when 'i' => if Ptr = Max then - Bad_Switch (C); + Bad_Switch ("-gnati"); end if; Ptr := Ptr + 1; @@ -532,9 +535,15 @@ package body Switch.C is Ptr := Ptr + 1; else - Bad_Switch (C); + Bad_Switch ("-gnati" & Switch_Chars (Ptr .. Max)); end if; + -- Processing for I switch + + when 'I' => + Ptr := Ptr + 1; + Ignore_Rep_Clauses := True; + -- Processing for j switch when 'j' => @@ -679,7 +688,7 @@ package body Switch.C is List_Representation_Info_Mechanisms := True; else - Bad_Switch (C); + Bad_Switch ("-gnatR" & Switch_Chars (Ptr .. Max)); end if; Ptr := Ptr + 1; @@ -745,7 +754,7 @@ package body Switch.C is Ptr := Ptr + 1; if Ptr > Max then - Bad_Switch (C); + Bad_Switch ("-gnatV"); else declare @@ -756,7 +765,7 @@ package body Switch.C is (Switch_Chars (Ptr .. Max), OK, Ptr); if not OK then - Bad_Switch (C); + Bad_Switch ("-gnatV" & Switch_Chars (Ptr .. Max)); end if; for Index in First_Char + 1 .. Max loop @@ -775,7 +784,7 @@ package body Switch.C is Ptr := Ptr + 1; if Ptr > Max then - Bad_Switch (C); + Bad_Switch ("-gnatw"); end if; while Ptr <= Max loop @@ -790,7 +799,7 @@ package body Switch.C is if Set_Dot_Warning_Switch (C) then Store_Compilation_Switch ("-gnatw." & C); else - Bad_Switch (C); + Bad_Switch ("-gnatw." & Switch_Chars (Ptr .. Max)); end if; -- Normal case, no dot @@ -799,7 +808,7 @@ package body Switch.C is if Set_Warning_Switch (C) then Store_Compilation_Switch ("-gnatw" & C); else - Bad_Switch (C); + Bad_Switch ("-gnatw" & Switch_Chars (Ptr .. Max)); end if; end if; @@ -814,7 +823,7 @@ package body Switch.C is Ptr := Ptr + 1; if Ptr > Max then - Bad_Switch (C); + Bad_Switch ("-gnatW"); end if; begin @@ -822,7 +831,7 @@ package body Switch.C is Get_WC_Encoding_Method (Switch_Chars (Ptr)); exception when Constraint_Error => - Bad_Switch (C); + Bad_Switch ("-gnatW" & Switch_Chars (Ptr .. Max)); end; Upper_Half_Encoding := @@ -906,7 +915,7 @@ package body Switch.C is Distribution_Stub_Mode := Generate_Caller_Stub_Body; when others => - Bad_Switch (C); + Bad_Switch ("-gnatz" & Switch_Chars (Ptr .. Max)); end case; Ptr := Ptr + 1; @@ -923,13 +932,13 @@ package body Switch.C is when '8' => if Ptr = Max then - Bad_Switch (C); + Bad_Switch ("-gnat8"); end if; Ptr := Ptr + 1; if Switch_Chars (Ptr) /= '3' then - Bad_Switch (C); + Bad_Switch ("-gnat8" & Switch_Chars (Ptr .. Max)); else Ptr := Ptr + 1; Ada_Version := Ada_83; @@ -940,13 +949,13 @@ package body Switch.C is when '9' => if Ptr = Max then - Bad_Switch (C); + Bad_Switch ("-gnat9"); end if; Ptr := Ptr + 1; if Switch_Chars (Ptr) /= '5' then - Bad_Switch (C); + Bad_Switch ("-gnat9" & Switch_Chars (Ptr .. Max)); else Ptr := Ptr + 1; Ada_Version := Ada_95; @@ -957,13 +966,13 @@ package body Switch.C is when '0' => if Ptr = Max then - Bad_Switch (C); + Bad_Switch ("-gnat0"); end if; Ptr := Ptr + 1; if Switch_Chars (Ptr) /= '5' then - Bad_Switch (C); + Bad_Switch ("-gnat0" & Switch_Chars (Ptr .. Max)); else Ptr := Ptr + 1; Ada_Version := Ada_05; @@ -978,7 +987,7 @@ package body Switch.C is -- Anything else is an error (illegal switch character) when others => - Bad_Switch (C); + Bad_Switch ("-gnat" & Switch_Chars (Ptr .. Max)); end case; if Store_Switch then |