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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: Luke A. Guest Newsgroups: comp.lang.ada Subject: Re: Any Suggestion How To Accomplish A Debug Macro? Date: Wed, 31 Dec 2014 00:15:47 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: <1238045055441677541.132126laguest-archeia.com@nntp.aioe.org> References: NNTP-Posting-Host: a3sdUbp6gfW+CtsdY0M2Tg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: NewsTap/4.0.1 (iPhone/iPod Touch) X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:24300 Date: 2014-12-31T00:15:47+00:00 List-Id: Brad Moore wrote: > On 14-12-30 04:14 AM, Simon Wright wrote: >> Hubert writes: > This works in GNAT, and might work in other compilers as well. Worst case > is that the Debug_Enabled boolean get evaluated in multiple places, but > that overhead of evaluating a Boolean might still be acceptable for a > compiler that doesn't do dead code elimination. Not strictly true as the compiler should see the "if var = true then" and remove the if in dead code elimination leaving the contents of the if statement. When the if statement is false (statically) the entire statement can be eliminated.