From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c81dfd55bff3db44 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?iso-8859-15?Q?Yannick_Duch=EAne_=28Hibou57=29?= Newsgroups: comp.lang.ada Subject: Re: Record aggregates assignments and the black-box and else Date: Mon, 10 May 2010 21:03:44 +0200 Organization: Ada At Home Message-ID: References: <314c8794-dbce-4fe1-b8d8-1258c782fbfe@u3g2000prl.googlegroups.com> NNTP-Posting-Host: ra5wLii/U0tbQP170oFAeA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news2.google.com comp.lang.ada:11462 Date: 2010-05-10T21:03:44+02:00 List-Id: Le Mon, 10 May 2010 17:20:08 +0200, Adam Beneschan a = =E9crit: > where R was previously uninitialized. Even though R.A is supposed to > have subtype "Natural", if it's uninitialized and thus garbage, it > could have a negative value. Thus, it's possible that this > assignment, which is conceptually part of the assignment that creates > the temporary object: > > Temp_Object.A :=3D R.A; > > could raise an exception if R.A happened to have a garbage negative > value. What should be involved here, is access to uninitialized value rather th= an = range-check error. Unfortunately, I don't know a way to achieve this in = = Ada (except with some GNAT pragma which requires to initialize scalars s= o = as to be sure it will later raise a range-check error if it was not = properly initialized... still indirect) > Anyway, assuming that the compiler determines that R.A will not raise > an exception, and that B =3D> 5 cannot raise an exception either, and > there aren't any other reasons why R has to be preserved while the > temporary object is being created, it might decide that there's no > reason to create a temporary object. This is permissible since the > semantics would be exactly the same in all cases. Then it's > conceivable that the compiler could generate code that looks like I agree with you about this semantic equivalence. -- = No-no, this isn't an oops ...or I hope (TM) - Don't blame me... I'm just= = not lucky