comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: optimization away of checks in 'valid
Date: Wed, 26 Sep 2012 01:35:24 -0700 (PDT)
Date: 2012-09-26T01:35:24-07:00	[thread overview]
Message-ID: <b1b0d2a4-2b35-43e8-8ce5-506ff112b189@googlegroups.com> (raw)
In-Reply-To: <5a0711d8-81ad-4200-9b6e-a80feffd5302@googlegroups.com>

Joseph Wisniewski wrote on comp.lang.ada:
> we had a case where C++ code was not checking the bounds of a
> integer subtype as it was passed to Ada code via a function
> parameter. The Ada code _was_ checking via 'valid. 'valid returned
> true even though the integer value was out of bounds. Turns out the
> compiler relied on the "allowed assumption" that all callers "check
> their bounds" for such data.

I'd think this assumption should be disallowed for exported
subprograms, or actually for all subprograms with a Convention other
than Ada?

-- 
Ludovic Brenta.



  reply	other threads:[~2012-09-26  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-26  1:33 optimization away of checks in 'valid Joseph Wisniewski
2012-09-26  8:35 ` Ludovic Brenta [this message]
2012-09-26 16:46   ` Jeffrey Carter
2012-09-26 12:01 ` Georg Bauhaus
2012-09-27  6:00 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox