diff options
author | Robert Dewar <dewar@adacore.com> | 2009-04-09 10:38:54 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-04-09 12:38:54 +0200 |
commit | 923e6ff331d3e4c0109529937c5ee589dfbe93b8 (patch) | |
tree | 31ba08971e0c8db8e92b164c64a7ddadbd742ba1 /gcc/ada/binderr.adb | |
parent | beb50807addf7817dafe8c229f9e9d9a09f5b828 (diff) | |
download | gcc-923e6ff331d3e4c0109529937c5ee589dfbe93b8.zip gcc-923e6ff331d3e4c0109529937c5ee589dfbe93b8.tar.gz gcc-923e6ff331d3e4c0109529937c5ee589dfbe93b8.tar.bz2 |
binderr.adb, [...]: New circuitry for handling Maximum_Messages.
2009-04-09 Robert Dewar <dewar@adacore.com>
* binderr.adb, errout.adb, errutil.adb: New circuitry for handling
Maximum_Messages.
* erroutc.adb, erroutc.ads (Warnings_Suppressed): Now tests global
warning status as well.
* opt.ads (Maximum_Messages): New name for Maximum_Errors.
* switch-b.adb, switch-c.adb: Change name Maximum_Errors to
Maximum_Messages.
* bindusg.adb, usage.adb: Update line for -gnatm switch
* gnat_ugn.texi: Update documentation for -gnatmnn compiler switch and
-mnn binder switch.
* sem_ch10.adb: Minor reformatting.
From-SVN: r145822
Diffstat (limited to 'gcc/ada/binderr.adb')
-rw-r--r-- | gcc/ada/binderr.adb | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gcc/ada/binderr.adb b/gcc/ada/binderr.adb index 4f90ee68..830a2f1 100644 --- a/gcc/ada/binderr.adb +++ b/gcc/ada/binderr.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2007, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2008, 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- -- @@ -64,10 +64,24 @@ package body Binderr is Error_Msg_Output (Msg, Info => False); end if; - if Warnings_Detected + Errors_Detected > Maximum_Errors then - raise Unrecoverable_Error; + -- If too many warnings print message and then turn off warnings + + if Warnings_Detected = Maximum_Messages then + Set_Standard_Error; + Write_Line ("maximum number of warnings reached"); + Write_Line ("further warnings will be suppressed"); + Set_Standard_Output; + Warning_Mode := Suppress; end if; + -- If too many errors print message and give fatal error + + if Errors_Detected = Maximum_Messages then + Set_Standard_Error; + Write_Line ("fatal error: maximum number of errors exceeded"); + Set_Standard_Output; + raise Unrecoverable_Error; + end if; end Error_Msg; -------------------- @@ -99,7 +113,7 @@ package body Binderr is Warning : Boolean := False; begin - if Warnings_Detected + Errors_Detected > Maximum_Errors then + if Warnings_Detected + Errors_Detected > Maximum_Messages then Write_Str ("error: maximum errors exceeded"); Write_Eol; return; |