From 880dabb586a7da7a9198319daef82bf87df7422c Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 26 Oct 2010 15:00:05 +0200 Subject: [multiple changes] 2010-10-26 Robert Dewar * 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 * sem_ch8.adb (Analyze_Subprogram_Renaming): Improve warning when an operator renames another one with a different name. 2010-10-26 Thomas Quinot * exp_ch4.adb, exp_pakd.adb: Minor reformatting. From-SVN: r165956 --- gcc/ada/sem_cat.adb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gcc/ada/sem_cat.adb') 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 -- cgit v1.1