Re:Clang vs. Clang
by ncruces on Sunday August 04, 2024 @05:04AM
(#41152101)
The example is silly, but you should get the point. DEBUG can be anything.
[ Parent
| on HN ]
Re:Clang vs. Clang
by robinsonb5 on Monday August 05, 2024 @10:44AM
(#41161844)
Fair point, however your example is a runtime check, so shouldn't result in dead code.
(And if DEBUG is a static define then it still won't result in dead code since the preprocessor will remove it, and the compiler will never actually see it.)
EDIT: and now I realise I misread the first example all along - I read "#if (DEBUG)" rather than "if (DEBUG)".