aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/erroutc.ads
diff options
context:
space:
mode:
authorGhjuvan Lacambre <lacambre@adacore.com>2020-04-20 09:41:08 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-18 05:08:24 -0400
commit78689aa295f9b0e54807462d13d3125a5a83c64b (patch)
tree70f7c01b42926dbd73c20404cad0d85b5bded9dc /gcc/ada/erroutc.ads
parent668fb87d746afb36e22e48972fe379deb3a2184a (diff)
downloadgcc-78689aa295f9b0e54807462d13d3125a5a83c64b.zip
gcc-78689aa295f9b0e54807462d13d3125a5a83c64b.tar.gz
gcc-78689aa295f9b0e54807462d13d3125a5a83c64b.tar.bz2
[Ada] Do not treat pragma Compile_Time_Warning as error even with -gnatwe
2020-06-18 Ghjuvan Lacambre <lacambre@adacore.com> gcc/ada/ * erroutc.ads: Declare new Is_Compile_Time_Msg boolean, add new Compile_Time_Pragma field to Error_Msg_Object type. (Count_Compile_Time_Pragma_Warnings): New function. * erroutc.adb (Count_Compile_Time_Pragma_Warnings): New function. (Compilation_Errors): Take Compile_Time warnings into account when tallying Errors/Warnings. * errout.ads (Error_Msg): New procedure. * errout.adb (Error_Msg): New procedure. (Error_Msg_Internal): Set new Compile_Time_Pragma field in Error_Msg_Object. * errutil.adb (Error_Msg): Set new Compile_Time_Pragma field in Error_Msg_Object. * sem_prag.adb (Validate_Compile_Time_Warning_Or_Error): Pass True to new Error_Msg procedure. * doc/gnat_rm/implementation_defined_pragmas.rst: Update doc for the Compile_Time_Warning pragma. * gnat_rm.texi: Regenerate. * opt.ads: Update comment.
Diffstat (limited to 'gcc/ada/erroutc.ads')
-rw-r--r--gcc/ada/erroutc.ads12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ada/erroutc.ads b/gcc/ada/erroutc.ads
index f1c64a6..8472ee5 100644
--- a/gcc/ada/erroutc.ads
+++ b/gcc/ada/erroutc.ads
@@ -51,6 +51,10 @@ package Erroutc is
-- Set true to indicate that the current message contains the insertion
-- sequence !! (force warnings even in non-main unit source files).
+ Is_Compile_Time_Msg : Boolean := False;
+ -- Set true to indicate that the current message originates from a
+ -- Compile_Time_Warning or Compile_Time_Error pragma.
+
Is_Serious_Error : Boolean := False;
-- Set True for a serious error (i.e. any message that is not a warning
-- or style message, and that does not contain a | insertion character).
@@ -211,6 +215,10 @@ package Erroutc is
Col : Column_Number;
-- Column number for error message
+ Compile_Time_Pragma : Boolean;
+ -- True if the message originates from a Compile_Time_Warning or
+ -- Compile_Time_Error pragma
+
Warn : Boolean;
-- True if warning message
@@ -413,6 +421,10 @@ package Erroutc is
-- redundant. If so, the message to be deleted and all its continuations
-- are marked with the Deleted flag set to True.
+ function Count_Compile_Time_Pragma_Warnings return Int;
+ -- Returns the number of warnings in the Errors table that were triggered
+ -- by a Compile_Time_Warning pragma.
+
function Get_Warning_Tag (Id : Error_Msg_Id) return String;
-- Given an error message ID, return tag showing warning message class, or
-- the null string if this option is not enabled or this is not a warning.