From: gautier_niouzes@hotmail.com
Subject: Re: fyi, GNAT and SPARK GPL 2016 are out
Date: Sat, 4 Jun 2016 11:35:34 -0700 (PDT)
Date: 2016-06-04T11:35:34-07:00 [thread overview]
Message-ID: <1fbfa584-efcf-4e2c-9035-728cec528754@googlegroups.com> (raw)
In-Reply-To: <niuvov$kvf$1@dont-email.me>
Le samedi 4 juin 2016 18:31:29 UTC+2, Georg Bauhaus a écrit :
> Doesn't your workaround demonstrate just how the behavior
> shown by GNAT contradicts the one to expect from standards
> conformance? Or is -gnatp now overruling the effect which
>
> Element (No_Element)
>
> is supposed to have?
Indeed. Without pragma Suppress(Container_Checks) you get the RM05/12 behavior:
raised CONSTRAINT_ERROR : Test_2016.T_Dic.Element: Position cursor of function Element equals No_Element
(A.18.4 Maps: 33/2
function Element (Position : Cursor) return Element_Type;
34/2
If Position equals No_Element, then Constraint_Error is propagated. Otherwise, Element returns the element component of the node designated by Position.)
with pragma Suppress(Container_Checks) (or with -gnatp) you get
raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION
No coincidence, since you have in a-cohama.adb (GPL 2016 version):
function Element (Position : Cursor) return Element_Type is
begin
if Checks and then Position.Node = null then
raise Constraint_Error with
"Position cursor of function Element equals No_Element";
end if;
...
and (one click away):
Checks : constant Boolean := Container_Checks'Enabled;
Hence my question about Container_Checks being in a future version of the standard...
_________________________
Gautier's Ada programming
http://sf.net/users/gdemont/
next prev parent reply other threads:[~2016-06-04 18:35 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 13:33 fyi, GNAT and SPARK GPL 2016 are out Nasser M. Abbasi
2016-06-01 22:22 ` daserlang
2016-06-02 12:56 ` mockturtle
2016-06-03 1:56 ` David Botton
2016-06-03 7:16 ` Simon Wright
2016-06-05 8:00 ` ahlan.marriott
2016-06-05 8:42 ` gautier_niouzes
2016-06-05 10:02 ` Simon Wright
2016-06-04 16:13 ` gautier_niouzes
2016-06-04 16:31 ` Georg Bauhaus
2016-06-04 18:35 ` gautier_niouzes [this message]
2016-06-04 19:34 ` Simon Wright
2016-06-05 9:38 ` gautier_niouzes
2016-06-05 7:14 ` Randy Brukardt
2016-06-04 17:36 ` Jeffrey R. Carter
2016-06-05 14:07 ` Alejandro R. Mosteo
2016-06-05 18:02 ` Jeffrey R. Carter
2016-06-05 7:12 ` Randy Brukardt
2016-06-04 21:15 ` ogpual
2016-06-04 21:49 ` Simon Wright
2016-06-04 23:02 ` ogpual
2016-06-05 17:57 ` Hadrien Grasland
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox