summaryrefslogtreecommitdiff
path: root/gcc/ada/stylesw.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:25:29 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-06 09:25:29 +0000
commit59ac57b560f56b6c7944751f579fcedcfa22bc15 (patch)
tree5452d8d7f7de1a366e554e6d5ccd84c49ad180c9 /gcc/ada/stylesw.adb
parent271c020ead1f48b22927837e9617a5dc78bbbe9e (diff)
downloadgcc-59ac57b560f56b6c7944751f579fcedcfa22bc15.tar.gz
2007-04-06 Robert Dewar <dewar@adacore.com>
* sem_ch13.ads, sem_ch13.adb (Adjust_Record_For_Reverse_Bit_Order): Use First/Next_Component_Or_Discriminant (Analyze_Record_Representation_Clause): Use First/Next_Component_Or_Discriminant (Check_Component_Overlap): Use First/Next_Component_Or_Discriminant (Analyze_Attribute_Definition_Clause, case Value_Size): Reject definition if type is unconstrained. (Adjust_Record_For_Reverse_Bit_Order): New procedure (Analyze_Attribute_Definition_Clause): Split Is_Abstract flag into Is_Abstract_Subprogram and Is_Abstract_Type. (Adjust_Record_For_Reverse_Bit_Order): New procedure * repinfo.adb (List_Record_Info): Use First/ Next_Component_Or_Discriminant. * style.ads, styleg-c.adb, styleg-c.ads (Check_Array_Attribute_Index): New procedure. * stylesw.ads, stylesw.adb: Recognize new -gnatyA style switch Include -gnatyA in default switches * opt.ads: (Warn_On_Non_Local_Exception): New flag (Warn_On_Reverse_Bit_Order): New flag (Extensions_Allowed): Update the documentation. (Warn_On_Questionable_Missing_Parens): Now on by default * usage.adb: Add documentation of -gnatw.x/X switches Document new -gnatyA style switch -gnatq warnings are on by default git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123590 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/stylesw.adb')
-rw-r--r--gcc/ada/stylesw.adb99
1 files changed, 52 insertions, 47 deletions
diff --git a/gcc/ada/stylesw.adb b/gcc/ada/stylesw.adb
index e1eda448945..b27d4e03409 100644
--- a/gcc/ada/stylesw.adb
+++ b/gcc/ada/stylesw.adb
@@ -35,28 +35,29 @@ package body Stylesw is
procedure Reset_Style_Check_Options is
begin
- Style_Check_Indentation := 0;
- Style_Check_Attribute_Casing := False;
- Style_Check_Blanks_At_End := False;
- Style_Check_Blank_Lines := False;
- Style_Check_Comments := False;
- Style_Check_DOS_Line_Terminator := False;
- Style_Check_End_Labels := False;
- Style_Check_Form_Feeds := False;
- Style_Check_Horizontal_Tabs := False;
- Style_Check_If_Then_Layout := False;
- Style_Check_Keyword_Casing := False;
- Style_Check_Layout := False;
- Style_Check_Max_Line_Length := False;
- Style_Check_Max_Nesting_Level := False;
- Style_Check_Mode_In := False;
- Style_Check_Order_Subprograms := False;
- Style_Check_Pragma_Casing := False;
- Style_Check_References := False;
- Style_Check_Specs := False;
- Style_Check_Standard := False;
- Style_Check_Tokens := False;
- Style_Check_Xtra_Parens := False;
+ Style_Check_Indentation := 0;
+ Style_Check_Array_Attribute_Index := False;
+ Style_Check_Attribute_Casing := False;
+ Style_Check_Blanks_At_End := False;
+ Style_Check_Blank_Lines := False;
+ Style_Check_Comments := False;
+ Style_Check_DOS_Line_Terminator := False;
+ Style_Check_End_Labels := False;
+ Style_Check_Form_Feeds := False;
+ Style_Check_Horizontal_Tabs := False;
+ Style_Check_If_Then_Layout := False;
+ Style_Check_Keyword_Casing := False;
+ Style_Check_Layout := False;
+ Style_Check_Max_Line_Length := False;
+ Style_Check_Max_Nesting_Level := False;
+ Style_Check_Mode_In := False;
+ Style_Check_Order_Subprograms := False;
+ Style_Check_Pragma_Casing := False;
+ Style_Check_References := False;
+ Style_Check_Specs := False;
+ Style_Check_Standard := False;
+ Style_Check_Tokens := False;
+ Style_Check_Xtra_Parens := False;
end Reset_Style_Check_Options;
------------------------------
@@ -64,7 +65,7 @@ package body Stylesw is
------------------------------
procedure Save_Style_Check_Options (Options : out Style_Check_Options) is
- P : Natural := 0;
+ P : Natural := 0;
procedure Add (C : Character; S : Boolean);
-- Add given character C to string if switch S is true
@@ -109,6 +110,7 @@ package body Stylesw is
Style_Check_Indentation /= 0);
Add ('a', Style_Check_Attribute_Casing);
+ Add ('A', Style_Check_Array_Attribute_Index);
Add ('b', Style_Check_Blanks_At_End);
Add ('c', Style_Check_Comments);
Add ('d', Style_Check_DOS_Line_Terminator);
@@ -155,7 +157,7 @@ package body Stylesw is
procedure Set_Default_Style_Check_Options is
begin
Reset_Style_Check_Options;
- Set_Style_Check_Options ("3abcefhiklmnprst");
+ Set_Style_Check_Options ("3aAbcefhiklmnprst");
end Set_Default_Style_Check_Options;
-----------------------------
@@ -228,37 +230,40 @@ package body Stylesw is
Character'Pos (C) - Character'Pos ('0');
when 'a' =>
- Style_Check_Attribute_Casing := True;
+ Style_Check_Attribute_Casing := True;
+
+ when 'A' =>
+ Style_Check_Array_Attribute_Index := True;
when 'b' =>
- Style_Check_Blanks_At_End := True;
+ Style_Check_Blanks_At_End := True;
when 'c' =>
- Style_Check_Comments := True;
+ Style_Check_Comments := True;
when 'd' =>
- Style_Check_DOS_Line_Terminator := True;
+ Style_Check_DOS_Line_Terminator := True;
when 'e' =>
- Style_Check_End_Labels := True;
+ Style_Check_End_Labels := True;
when 'f' =>
- Style_Check_Form_Feeds := True;
+ Style_Check_Form_Feeds := True;
when 'h' =>
- Style_Check_Horizontal_Tabs := True;
+ Style_Check_Horizontal_Tabs := True;
when 'i' =>
- Style_Check_If_Then_Layout := True;
+ Style_Check_If_Then_Layout := True;
when 'I' =>
- Style_Check_Mode_In := True;
+ Style_Check_Mode_In := True;
when 'k' =>
- Style_Check_Keyword_Casing := True;
+ Style_Check_Keyword_Casing := True;
when 'l' =>
- Style_Check_Layout := True;
+ Style_Check_Layout := True;
when 'L' =>
Style_Max_Nesting_Level := 0;
@@ -289,11 +294,11 @@ package body Stylesw is
Style_Check_Max_Nesting_Level := Style_Max_Nesting_Level /= 0;
when 'm' =>
- Style_Check_Max_Line_Length := True;
- Style_Max_Line_Length := 79;
+ Style_Check_Max_Line_Length := True;
+ Style_Max_Line_Length := 79;
when 'M' =>
- Style_Max_Line_Length := 0;
+ Style_Max_Line_Length := 0;
if Err_Col > Options'Last
or else Options (Err_Col) not in '0' .. '9'
@@ -321,34 +326,34 @@ package body Stylesw is
or else Options (Err_Col) not in '0' .. '9';
end loop;
- Style_Check_Max_Line_Length := Style_Max_Line_Length /= 0;
+ Style_Check_Max_Line_Length := Style_Max_Line_Length /= 0;
when 'n' =>
- Style_Check_Standard := True;
+ Style_Check_Standard := True;
when 'N' =>
Reset_Style_Check_Options;
when 'o' =>
- Style_Check_Order_Subprograms := True;
+ Style_Check_Order_Subprograms := True;
when 'p' =>
- Style_Check_Pragma_Casing := True;
+ Style_Check_Pragma_Casing := True;
when 'r' =>
- Style_Check_References := True;
+ Style_Check_References := True;
when 's' =>
- Style_Check_Specs := True;
+ Style_Check_Specs := True;
when 't' =>
- Style_Check_Tokens := True;
+ Style_Check_Tokens := True;
when 'u' =>
- Style_Check_Blank_Lines := True;
+ Style_Check_Blank_Lines := True;
when 'x' =>
- Style_Check_Xtra_Parens := True;
+ Style_Check_Xtra_Parens := True;
when ' ' =>
null;