develooper Front page | perl.perl5.porters | Postings from October 2017

[perl #132159] Use preprocessor check for some DEBUG_X_TEST calls insv.c and toke.c

From:
Tony Cook via RT
Date:
October 16, 2017 00:48
Subject:
[perl #132159] Use preprocessor check for some DEBUG_X_TEST calls insv.c and toke.c
Message ID:
rt-4.0.24-4705-1508114877-1444.132159-15-0@perl.org
On Wed, 27 Sep 2017 09:34:18 -0700, atoomic wrote:
> Hi Tony, I agree with you this is [probably] not necessary but would
> mark it as 'good to have'.
> 
> I would also assume that during compilation optimizations can discard
> 'if (0)' blocks. But in my understanding, this might depend on your
> compiler and options you used.
> 
> Enforcing the pre-processor check guarantee that it always behave the
> same, and is consistent with the existing code. If you check the
> codebase, most of other places consuming these DEBUG macros (to do not
> say all) are already protected by a '#ifdef DEBUGGING' check.
> 
> I saw no warnings and just noticed it while reviewing a case.
> 
> The other argument for it, I have for it is when compiling a non-DEBUG
> perl but with symbols:  ./Configure -Dusedevel -Doptimize=-g3 -des
> 
> I do not want to view non-existing blocks during my gdb sessions.

You've convinced me, thanks, applied as f0e51ad56d2b90cda983b65e21526fd1bdf422b6.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=132159



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About