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-Thread: 103376,400766bdbcd86f7c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!newsfeed1.ip.tiscali.net!tiscali!transit1.news.tiscali.nl!dreader2.news.tiscali.nl!not-for-mail Newsgroups: comp.lang.ada Subject: Re: This can't be done in Ada...or? References: <1108139611.709714.36170@o13g2000cwo.googlegroups.com> From: Ludovic Brenta Date: Sat, 12 Feb 2005 00:51:57 +0100 Message-ID: <87fz02k63m.fsf@insalien.org> User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:Bg2ujx4EqhjgC/u6dm7U+GH/xCo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tiscali bv NNTP-Posting-Date: 12 Feb 2005 00:35:25 CET NNTP-Posting-Host: 83.134.239.16 X-Trace: 1108164925 dreader2.news.tiscali.nl 44095 83.134.239.16:33110 X-Complaints-To: abuse@tiscali.nl Xref: g2news1.google.com comp.lang.ada:8260 Date: 2005-02-12T00:35:25+01:00 List-Id: Robert A Duff writes: > The compiler can optimize away everything inside the "if > Logging_Enabled". But it can't optimize away the evaluation of the > parameters unless it can prove the absence of side effects. For > example: > > Trace.Error(..., "Bad value of X " & Debug_Info(X)); > > where Debug_Info is some user-defined function that produces useful > debug info about some complicated data structure called X. It has > no side effects, but the compiler doesn't know that, usually. What if Debug_Info is in a Pure package? Does the compiler still have to consider possible side effects? I'm really curious. -- Ludovic Brenta.