3 ms·
It's fairly typical. The standard "assert" macro behaves exactly that way, it does not generate code if the code is compiled with NDEBUG defined. Of course you
by simias 13y ago
It's fairly typical. The standard "assert" macro behaves exactly that way, it does not generate code if the code is compiled with NDEBUG defined.
Of course you shouldn't abuse it but in this instance it's perfectly fine IMHO.
This reminds me that in addition to that the linux kernel has a pretty cool feature for debugging called "dynamic debugging" where you can enable and disable "printk" (the kernel's version of printf) messages dynamically from the shell through the debugfs:
http://lwn.net/Articles/434833/ http://lwn.net/Articles/434833/