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,d0310bb11aeb7260,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.15.105 with SMTP id w9mr23793224pbc.7.1321389422861; Tue, 15 Nov 2011 12:37:02 -0800 (PST) Path: h5ni58578pba.0!nntp.google.com!news2.google.com!postnews.google.com!k26g2000yqd.googlegroups.com!not-for-mail From: awdorrin Newsgroups: comp.lang.ada Subject: GNAT 4.4.5 order of conditional processing? Date: Tue, 15 Nov 2011 12:30:07 -0800 (PST) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 192.35.35.34 Mime-Version: 1.0 X-Trace: posting.google.com 1321389422 16357 127.0.0.1 (15 Nov 2011 20:37:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 15 Nov 2011 20:37:02 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k26g2000yqd.googlegroups.com; posting-host=192.35.35.34; posting-account=YkFdLgoAAADpWnfCBA6ZXMWTz2zHNd0j User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe) Xref: news2.google.com comp.lang.ada:14418 Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-11-15T12:30:07-08:00 List-Id: Given an IF statement such as the following: if X = Y and not A and B How does GNAT handle the processing of the conditional statements? Will "X = Y" be processed first, and if false, will the rest be skipped? Reason I'm asking is I'm porting code, and it appears as if all of the statements are being evaluated, even though the "X = Y" part is already false. I'm not sure if there is some optimization going on and if there is, is there a compiler flag to disable it. Guessing the best thing to do would be to rewrite the code to something clearer like: if X = Y then if not A then if B then ... But I was curious since this is something that is probably a hundred places through out this collection of source code. Thanks -Al