CVS difference for ai12s/ai12-0112-1.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai12s/ai12-0112-1.txt

--- ai12s/ai12-0112-1.txt	2017/04/21 05:43:52	1.2
+++ ai12s/ai12-0112-1.txt	2018/01/18 20:36:46	1.3
@@ -1279,3 +1279,52 @@
+topic Pragma Suppress (Container_Checks)
+!reference Ada 202x 2012 RM11.5, A.18.4
+!from Gautier de Montmollin 17-12-05
+!keywords Suppress Container_Checks
+Like it or not, GNAT has a pragma Suppress (Container_Checks) which is
+activated with the -gnatp option. It changes changes the behaviour
+of Maps (and perhaps other containers) when an element hasn't been
+found: the behaviour of function Element @ A.18.4 34/2 fails, and
+Constraint_Error is NOT propagated as expected.
+Especially, function Element (Container : Map; Key : Key_Type) return Element_Type; (68/2)
+cannot be used at all.
+Actually my proposal is either:
+  - For the Ada standard, to add this pragma. It would join the other documented
+    pragmata in 11.5 (Suppressing Checks) that have to be used with caution.
+  - Or for the GNAT compiler, to warn better of the risks of this undocumented
+    (in the Ada standard sense) pragma
+From: Randy Brukardt
+Sent: Tuesday, December 5, 2017  3:57 PM
+(1) pragma Suppress always causes the risk of making a program's erroneous.
+If this is a real concern (and it should be), don't use pragma Suppress.
+(It's almost never necessary with modern compilers which can eliminate the
+vast majority of checks by optimizations.) [I'm not going to say more here,
+as it would get off-topic; I had much more to say about this in a recent
+comp.lang.ada thread.]
+(2) We already have this issue on our radar. In particular, AI12-0112-1
+intends to make almost all of the container checks into explicit preconditions
+and provide a way to suppress language-defined preconditions. This will make
+the description of the checks clearer and still provide the functionality if
+it is needed.
+(3) 11.5(27/2) allows an implementation to define additional check names for
+Suppress. There's no requirement that the check names be language-defined.
+So GNAT is perfectly OK defining Container_Check, Box_Check, Gautier_Check,
+or any other name that they like. :-) As to the quality of their
+documentation, that's hardly a language Standard concern.

Questions? Ask the ACAA Technical Agent