|
From: Tom H. <to...@co...> - 2006-01-20 00:20:46
|
In message <113...@li...>
Uttam Pawar <ut...@us...> wrote:
> I've a patch ready to submit which has few cleanup changes. If you look at
> the patch, the code in if (verboze) condition is a dead code as verboze is
> initialized 'False'. I can understand that, the code in the condition is
> some kind of debug output which might be necessary from time to time to
> print the intermediate debug output. So my proposal is to make this output
> available with -D compiler option. So if somebody wants to enable the extra
> output he/she can make debug build (which has some extra option with -D)
> instead of changing the code everytime he/she wants to enable/disable this
> output. Going further we can use this flag in other places in the code to
> plant some intermediate checkpoints,
This (having a static variable initialised to false which guards
debug code) is a common technique in valgrind and seems perfectly
reasonable to me. Whay do you want to change to a preprocessor
conditional?
One advantage of the way we do it at the moment is that the debug
code can't get out of date as it is always parsed by the compiler
even when debugging is not on.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|