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 14:22:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Unchecked_Deallocation subtleties Date: Wed, 9 Apr 2003 16:23:36 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:36035 Date: 2003-04-09T16:23:36-05:00 List-Id: Piotr Zgorecki wrote in message ... >Hi, > >I have a problem with interpretation of ARM 13.11.2(8): > >"Free(X), when X is already equal to null, has no effect." > >I'm looking at an implementation which will call user-defined >Deallocate, whether X is null or not. Is it correct? I would suppose >'has no effect' means that Deallocate shouldn't be called, because it >can potentially have side effects. Life would be easier if ARM had 'no >effect' stuff strictly defined. The implementation is clearly wrong. The only place that the standard ever talks about calling the storage pool Deallocate is in 13.11.2(9). That paragraph starts with "Free(X), when X is not already equal to null...". So, there is no justification for calling Deallocate, or Finalize, or doing anything when X is not null. "no effect" here means just that -- no effect: nothing is called, executed, etc. I do agree that that term is not formally defined, so there is a bit of wiggle room for implementations, but calling arbitrary routines because its convinient seems to be beyond any wiggle room. Especially as it is easy to do it correctly. That said, unless you can get a patch from a vendor (and that usually means that you're a favored customer), you probably ought to work around it - it does not seem hard to do so. Randy Brukardt