diff options
author | Robert Dewar <dewar@adacore.com> | 2006-02-15 10:36:45 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2006-02-15 10:36:45 +0100 |
commit | 61dddae4e72e300597afeff4b081114a25598c5f (patch) | |
tree | 21c6aed88c4d5ed4dfbc700b0cbb33b914758de6 /gcc/ada/switch-m.adb | |
parent | 86ac5e79ab137815e463c0b46495551c641e33d8 (diff) | |
download | gcc-61dddae4e72e300597afeff4b081114a25598c5f.tar.gz |
debug.adb: Eliminate numeric switches for binder/gnatmake
2006-02-13 Robert Dewar <dewar@adacore.com>
Vincent Celier <celier@adacore.com>
* debug.adb: Eliminate numeric switches for binder/gnatmake
* switch-m.adb (Normalize_Compiler_Switches): Record numeric debug
switches for the compiler.
(Scan_Make_Switches): Do not allow numeric debug switches for gnatmake
(Scan_Make_Switches): When failing with an illegal switch, output an
error message with the full switch.
Eliminate numeric switches for binder/gnatmake
* switch.ads, switch.adb (Bad_Switch): New procedure
* switch-b.adb (Scan_Binder_Switches): Do not accept combined switches.
Remove 0-9 as debug flag character possibilities
-d is now controlling the primary stack size when its value is a
positive. Also add checks against invalid values, and support for kb,
mb. Ditto for -D switch.
From-SVN: r111053
Diffstat (limited to 'gcc/ada/switch-m.adb')
-rw-r--r-- | gcc/ada/switch-m.adb | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/gcc/ada/switch-m.adb b/gcc/ada/switch-m.adb index bad932a01a6..b193a112fa8 100644 --- a/gcc/ada/switch-m.adb +++ b/gcc/ada/switch-m.adb @@ -491,7 +491,7 @@ package body Switch.M is -- Skip past the initial character (must be the switch character) if Ptr = Max then - Bad_Switch (C); + Bad_Switch (Switch_Chars); else Ptr := Ptr + 1; @@ -573,15 +573,11 @@ package body Switch.M is while Ptr < Max loop Ptr := Ptr + 1; C := Switch_Chars (Ptr); - exit when C = ASCII.NUL or else C = '/' or else C = '-'; - if C in '1' .. '9' or else - C in 'a' .. 'z' or else - C in 'A' .. 'Z' - then + if C in 'a' .. 'z' or else C in 'A' .. 'Z' then Set_Debug_Flag (C); else - Bad_Switch (C); + Bad_Switch (Switch_Chars); end if; end loop; @@ -593,7 +589,7 @@ package body Switch.M is Ptr := Ptr + 1; if Ptr > Max then - Bad_Switch (C); + Bad_Switch (Switch_Chars); end if; case Switch_Chars (Ptr) is @@ -611,7 +607,7 @@ package body Switch.M is Follow_Links := True; when others => - Bad_Switch (C); + Bad_Switch (Switch_Chars); end case; -- Processing for f switch @@ -641,6 +637,10 @@ package body Switch.M is -- Processing for j switch when 'j' => + if Ptr = Max then + Bad_Switch (Switch_Chars); + end if; + Ptr := Ptr + 1; declare @@ -721,7 +721,7 @@ package body Switch.M is Verbosity_Level := Opt.High; when others => - Osint.Fail ("invalid switch: ", Switch_Chars); + Bad_Switch (Switch_Chars); end case; Ptr := Ptr + 1; @@ -739,20 +739,15 @@ package body Switch.M is Ptr := Ptr + 1; No_Main_Subprogram := True; - -- Ignore extra switch character - - when '/' | '-' => - Ptr := Ptr + 1; - -- Anything else is an error (illegal switch character) when others => - Bad_Switch (C); + Bad_Switch (Switch_Chars); end case; if Ptr <= Max then - Osint.Fail ("invalid switch: ", Switch_Chars); + Bad_Switch (Switch_Chars); end if; end Check_Switch; |