aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_cat.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-26 15:00:05 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-26 15:00:05 +0200
commit880dabb586a7da7a9198319daef82bf87df7422c (patch)
treea00f59d391906e9e2674b5607e6baf48f833deec /gcc/ada/sem_cat.adb
parent392314047357798f0dffb3e5582f890489a3204f (diff)
downloadgcc-880dabb586a7da7a9198319daef82bf87df7422c.zip
gcc-880dabb586a7da7a9198319daef82bf87df7422c.tar.gz
gcc-880dabb586a7da7a9198319daef82bf87df7422c.tar.bz2
[multiple changes]
2010-10-26 Robert Dewar <dewar@adacore.com> * opt.ads: Comment fix. * sem_cat.adb: Treat categorization errors as warnings in GNAT Mode. * switch-c.adb: GNAT Mode does not set Treat_Categorization_Errors_As_Warnings. 2010-10-26 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Analyze_Subprogram_Renaming): Improve warning when an operator renames another one with a different name. 2010-10-26 Thomas Quinot <quinot@adacore.com> * exp_ch4.adb, exp_pakd.adb: Minor reformatting. From-SVN: r165956
Diffstat (limited to 'gcc/ada/sem_cat.adb')
-rw-r--r--gcc/ada/sem_cat.adb13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb
index a4edd3e..9311beb 100644
--- a/gcc/ada/sem_cat.adb
+++ b/gcc/ada/sem_cat.adb
@@ -226,10 +226,19 @@ package body Sem_Cat is
if Err then
- -- These messages are warnings in GNAT mode or if the -gnateC switch
+ -- These messages are warnings in GNAT mode or if the -gnateP switch
-- was set. Otherwise these are real errors for real illegalities.
- Error_Msg_Warn := Treat_Categorization_Errors_As_Warnings;
+ -- The reason we suppress these errors in GNAT mode is that the run-
+ -- time has several instances of violations of the categorization
+ -- errors (e.g. Pure units withing Preelaborate units. All these
+ -- violations are harmless in the cases where we intend them, and
+ -- we suppress the warnings with Warnings (Off). In cases where we
+ -- do not intend the violation, warnings are errors in GNAT mode
+ -- anyway, so we will still get an error.
+
+ Error_Msg_Warn :=
+ Treat_Categorization_Errors_As_Warnings or GNAT_Mode;
-- Don't give error if main unit is not an internal unit, and the
-- unit generating the message is an internal unit. This is the