[Ada] Warn about conversion with any predefined time types

Pierre-Marie de Rodat derodat@adacore.com
Mon Oct 11 13:39:42 GMT 2021


We already had a warning for unchecked conversions that involve the
private type Ada.Calendar.Time, whose representation might differ
between releases and targets of the compiler. Now this warning is
extended to Ada.Real_Time.Time and Ada.Real_Time.Time_Span, which is
similarly non-portable.

Previously the warning message referred to Time with no quotes; now all
the type names are in quotes, both because that's how we refer to entity
names in messages and because it is actually hard to omit the quotes
with the current API for error reporting.

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

gcc/ada/

	* sem_ch13.adb (Validate_Unchecked_Conversion): Simplify code
	for detecting conversions with Ada.Calendar.Time type and extend
	it to similar types in the Ada.Real_Time package.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 3283 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20211011/c1d97f62/attachment.bin>


More information about the Gcc-patches mailing list