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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b2dd3ff35d68d825 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-09 09:55:50 PST Message-ID: <3E94502E.6070108@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Unchecked_Deallocation subtleties References: <87smssj94u.fsf@inf.enst.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 09 Apr 2003 12:54:06 -0400 NNTP-Posting-Host: 198.96.47.195 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1049907245 198.96.47.195 (Wed, 09 Apr 2003 12:54:05 EDT) NNTP-Posting-Date: Wed, 09 Apr 2003 12:54:05 EDT Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:36024 Date: 2003-04-09T12:54:06-04:00 List-Id: Marin David Condic wrote: > Samuel Tardieu wrote in message > news:87smssj94u.fsf@inf.enst.fr... > >>"no effect" means "no user observable effect". Just as if you didn't >>call "Free(X)". If "Deallocate" may have side effects, it should not >>be called. >> > > No side effect other than possibly execution time. I don't believe the ARM > considers execution time to to be a factor in determining if there is "no > effect" - but obviously, in some applications, that might be an issue. > > MDC > -- > ====================================================================== > Marin David Condic > I work for: http://www.belcan.com/ I have always believed that this type of "permissiveness" is bad. If the caller knew in advance that there was nothing to free, then Free(X) would never be called in the first place. To me, this (when X is null) should raise an exception since it represents an unintended operation or state of the access type. It appears that a concession has been made to lazy programmers so that they can avoid the necessary if statements, such as: if X /= null then Free(X); end if; This issue must have been hotly debated at one time or another (and perhaps re-occuringly so). Of course, you can always insist on a different behaviour, by including a wrapper routine in your application (but I still would have preferred the other "default"). -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg