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,3a1c64628a09855b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newscon02.news.prodigy.net!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Lack of formal syntax undermines Ada Date: Sat, 12 Apr 2008 21:16:25 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <480102d3$0$19814$4d3efbfe@news.sover.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1208049385 27938 192.74.137.71 (13 Apr 2008 01:16:25 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sun, 13 Apr 2008 01:16:25 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:ZsBz4MAhzxCQhip9o7/M1pVWPd8= Xref: g2news1.google.com comp.lang.ada:20905 Date: 2008-04-12T21:16:25-04:00 List-Id: Gary Scott writes: > In some languages that have pure functions, the compiler is free to not > execute the function call if it can determine the return value by other > means and so eliminate the code entirely (nor inline it). I was > thinking thinking there might be situations where a C procedure call > might be optimized away based upon assumptions of purity > (pureness?). Well, normally an Ada compiler/optimizer is not supposed to assume things that are not true. There are some exceptions -- for example, if you suppress run-time checks, and divide by X, and X=0, the compiler can (and should!) assume that X is not 0. If a pragma Pure applies to a function, then you had better beware if that function is written in C! But normally, the compiler cannot assume that any function is pure, unless it can prove it to be true. >... Probably an outdated question based upon recent posts. OK. ;-) - Bob