diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-12 17:01:16 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-12 17:01:16 +0100 |
commit | ca0eb951e3e6cbee039db654df513d823fa86c78 (patch) | |
tree | 6947b25f5f34c7ae96aa0a29be8ed4aed928a2e6 /gcc/ada/errout.adb | |
parent | 661131664980c54b72c6223a53a464f23b8ec0a3 (diff) | |
download | gcc-ca0eb951e3e6cbee039db654df513d823fa86c78.zip gcc-ca0eb951e3e6cbee039db654df513d823fa86c78.tar.gz gcc-ca0eb951e3e6cbee039db654df513d823fa86c78.tar.bz2 |
[multiple changes]
2017-01-12 Tristan Gingold <gingold@adacore.com>
* s-mmap.ads, s-mmap.adb, s-mmosin-unix.ads, s-mmosin-unix.adb,
s-mmauni-long.ads, s-mmosin-mingw.ads, s-mmosin-mingw.adb: New files.
2017-01-12 Yannick Moy <moy@adacore.com>
* errout.adb, errout.ads (Initialize): Factor common treatment
in Reset_Warnings.
(Reset_Warnings): New procedure to reset counts related to warnings.
(Record_Compilation_Errors): New variable to store the presence of an
error, used in gnat2why to allow changing the Warning_Mode.
(Compilation_Errors): Use new variable Record_Compilation_Errors to
store the presence of an error.
2017-01-12 Javier Miranda <miranda@adacore.com>
* sem_ch13.adb (Analyze_Aspect_Specifications):
For Interrupt_Handler and Attach_ Handler aspects, decorate the
internally built reference to the protected procedure as coming
from sources and force its analysis.
2017-01-12 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Build_Derived_Type): For a scalar derived type,
inherit predicates if any from the first_subtype of the parent,
not from the anonymous parent type.
* sem_eval.adb (Is_Static_Subtype): A type that inherits a dynamic
predicate is not a static subtype.
2017-01-12 Gary Dismukes <dismukes@adacore.com>
* freeze.adb (Check_Suspicious_Convention): New procedure
performing a warning check on discriminated record types with
convention C or C++. Factored out of procedure Freeze_Record_Type,
and changed to only apply to base types (to avoid spurious
warnings on subtypes). Minor improvement of warning messages
to refer to discriminated rather than variant record types.
(Freeze_Record_Type): Remove code for performing a suspicious
convention check.
(Freeze_Entity): Only call Freeze_Record_Type
on types that aren't declared within any enclosing generic units
(rather than just excluding the type when the innermost scope
is generic). Call Check_Suspicious_Convention whether or not
the type is declared within a generic unit.
* sem_ch8.adb (In_Generic_Scope): Move this function to Sem_Util.
* sem_util.ads, sem_util.adb (In_Generic_Scope): New function (moved
from Sem_Ch8).
2017-01-12 Tristan Gingold <gingold@adacore.com>
* sysdep.c, adaint.c, rtinit.c, ming32.h:
(__gnat_current_codepage): Renamed from CurrentCodePage
(__gnat_current_ccs_encoding): Renamed from CurrentCCSEncoding
2017-01-12 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Fully_Conformant_Expressions): Handle properly
quantified expressions, following AI12-050: the loop parameters
of two quantified expressions are conformant if they have the
same identifier.
From-SVN: r244369
Diffstat (limited to 'gcc/ada/errout.adb')
-rw-r--r-- | gcc/ada/errout.adb | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index 49aa2a7..001072d 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -60,6 +60,13 @@ package body Errout is Finalize_Called : Boolean := False; -- Set True if the Finalize routine has been called + Record_Compilation_Errors : Boolean := False; + -- Record that a compilation error was witnessed during a given phase of + -- analysis for gnat2why. This is needed as Warning_Mode is modified twice + -- in gnat2why, hence Erroutc.Compilation_Errors can only return a suitable + -- value for each phase of analysis separately. This is updated at each + -- call to Compilation_Errors. + Warn_On_Instance : Boolean; -- Flag set true for warning message to be posted on instance @@ -236,8 +243,17 @@ package body Errout is begin if not Finalize_Called then raise Program_Error; + + -- Record that a compilation error was witnessed during a given phase of + -- analysis for gnat2why. This is needed as Warning_Mode is modified + -- twice in gnat2why, hence Erroutc.Compilation_Errors can only return a + -- suitable value for each phase of analysis separately. + else - return Erroutc.Compilation_Errors; + Record_Compilation_Errors := Record_Compilation_Errors or else + Erroutc.Compilation_Errors; + + return Record_Compilation_Errors; end if; end Compilation_Errors; @@ -1615,13 +1631,13 @@ package body Errout is Last_Error_Msg := No_Error_Msg; Serious_Errors_Detected := 0; Total_Errors_Detected := 0; - Warnings_Treated_As_Errors := 0; - Warnings_Detected := 0; - Info_Messages := 0; - Warnings_As_Errors_Count := 0; Cur_Msg := No_Error_Msg; List_Pragmas.Init; + -- Reset counts for warnings + + Reset_Warnings; + -- Initialize warnings tables Warnings.Init; @@ -2357,6 +2373,18 @@ package body Errout is end if; end Remove_Warning_Messages; + -------------------- + -- Reset_Warnings -- + -------------------- + + procedure Reset_Warnings is + begin + Warnings_Treated_As_Errors := 0; + Warnings_Detected := 0; + Info_Messages := 0; + Warnings_As_Errors_Count := 0; + end Reset_Warnings; + ---------------------- -- Adjust_Name_Case -- ---------------------- |