From 634a926b69be65a7b7db39f74538a91a98a89eab Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 25 Apr 2017 15:19:23 +0200 Subject: [multiple changes] 2017-04-25 Hristian Kirtchev * comperr.adb (Compiler_Abort): Add a pair of pragma Warnings On/Off to defend against a spurious warning in conditional compilation. * exp_ch4.adb (Rewrite_Comparison): Reimplemented. * namet.adb (Finalize): Add a pair of pragma Warnings On/Off to defend against a spurious warning in conditional compilation. * output.adb Add a pair of pragma Warnings On/Off to defend against a spurious warning in conditional compilation. * sem_eval.adb (Eval_Relational_Op): Major code clean up. (Fold_General_Op): New routine. (Fold_Static_Real_Op): New routine. (Test_Comparison): New routine. * sem_eval.ads (Test_Comparison): New routine. * sem_warn.adb (Is_Attribute_Constant_Comparison): New routine. (Warn_On_Constant_Valid_Condition): New routine. (Warn_On_Known_Condition): Use Is_Attribute_Constant_Comparison to detect a specific case. * sem_warn.adb (Warn_On_Constant_Valid_Condition): New routine. * urealp.adb (Tree_Read): Add a pair of pragma Warnings On/Off to defend against a spurious warning in conditional compilation. (Tree_Write): Add a pair of pragma Warnings On/Off to defend against a spurious warning in conditional compilation. * usage.adb Add a pair of pragma Warnings On/Off to defend against a spurious warning in conditional compilation. 2017-04-25 Arnaud Charlet * sinfo.ads, sem_ch13.adb: Update comment. From-SVN: r247224 --- gcc/ada/urealp.adb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'gcc/ada/urealp.adb') diff --git a/gcc/ada/urealp.adb b/gcc/ada/urealp.adb index 235a10d..5aaee7d 100644 --- a/gcc/ada/urealp.adb +++ b/gcc/ada/urealp.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2017, 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- -- @@ -493,7 +493,14 @@ package body Urealp is procedure Tree_Read is begin + -- Disable the warnings emitted by -gnatwc because the following check + -- acts as a signal in case Num_Ureal_Constants is changed. + + pragma Warnings + (Off, "condition can only be * if invalid values present"); pragma Assert (Num_Ureal_Constants = 10); + pragma Warnings + (On, "condition can only be * if invalid values present"); Ureals.Tree_Read; Tree_Read_Int (Int (UR_0)); @@ -518,7 +525,14 @@ package body Urealp is procedure Tree_Write is begin + -- Disable the warnings emitted by -gnatwc because the following check + -- acts as a signal in case Num_Ureal_Constants is changed. + + pragma Warnings + (Off, "condition can only be * if invalid values present"); pragma Assert (Num_Ureal_Constants = 10); + pragma Warnings + (On, "condition can only be * if invalid values present"); Ureals.Tree_Write; Tree_Write_Int (Int (UR_0)); -- cgit v1.1