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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7a3b1c6915ea1273 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.129.169 with SMTP id nx9mr3104699pbb.8.1326536420485; Sat, 14 Jan 2012 02:20:20 -0800 (PST) Path: lh20ni180766pbb.0!nntp.google.com!news2.google.com!postnews.google.com!p42g2000vbt.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: How many Ada compiler bugs are here? Date: Sat, 14 Jan 2012 02:20:19 -0800 (PST) Organization: http://groups.google.com Message-ID: <491fa855-f420-4701-a51a-39ac5a0cb63c@p42g2000vbt.googlegroups.com> References: <01dd6341-9c3c-4dcb-90f8-6ac66c65eb66@z1g2000vbx.googlegroups.com> NNTP-Posting-Host: 83.3.40.82 Mime-Version: 1.0 X-Trace: posting.google.com 1326536420 24367 127.0.0.1 (14 Jan 2012 10:20:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 14 Jan 2012 10:20:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: p42g2000vbt.googlegroups.com; posting-host=83.3.40.82; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-01-14T02:20:19-08:00 List-Id: On Jan 13, 1:21=A0am, "Randy Brukardt" wrote: > > 3. Logically, Tmp is never created, because Make_T raises an > > exception. Somehow some object is finalized. Apparently it is Tmp, > > which should not exist. > > 4. Somehow Tmp.initialized =3D True, even though its default value is > > defined to be False. > > I'm not sure if these are actually bugs or not; the fact that Adjust is > being called for a limited object means to me that nothing that happens > afterwards makes any sense Adjust is not called, but I have defined it to check if that's the case. Still, Adjust is not the biggest issue here, neither is the requirement for the return statement. The biggest issue is that the compiler fails to initialize some object (even ignoring the statically provided field initializers) and yet considers it to be worthy finalization - and the Finalize operation has absolutely no line of defense against this. This is a *very* serious problem. I have found it, because my program was crashing. And since this relates to the very fundamentals of the object model, this bug is not to be ignored. I can live with the rest, but this one is really serious. The workaround is this: type T is limited private; (note the lack of indefinite constraint - that is, we allow default objects) and then: procedure Init (Val : in out T; whateverelsehere); This works, but introduces the notion of uninitialized (default) object. The original version was stronger as it only allowed full proper objects. -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com