This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Issue check instead of error in static division by zero


In some cases of generic instantiations, or code configuration, some code
may be deactivated and contain static divisions by zero. Instead of
issuing an error in SPARK code, generate a suitable check.

Tested on x86_64-pc-linux-gnu, committed on trunk

2016-04-18  Yannick Moy  <moy@adacore.com>

	* sem_eval.adb (Eval_Arithmetic_Op): Do not issue error on static
	division by zero, instead possibly issue a warning.
	* sem_res.adb (Resolve_Arithmetic_Op): Do not issue error on
	static division by zero, instead add check flag on original
	expression.
	* sem_util.adb, sem_util.ads (Compile_Time_Constraint_Error):
	Only issue error when both SPARK_Mode is On and Warn is False.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]