Source of DEBUG define

I found the source of DEBUG define which break so many (all?) debug builds. It comes from here and here. I don’t know why HDF5 people decided to publicly export DEBUG define. NDEBUG is redundant as it is defined by the compiler. Anyway, the export propagates to tests and blows up in itkLoggerBase.h.

Renaming the DEBUG enumeration into something else e.g. DEBUGGING would work. Can someone think of a more elegant solution to this problem?

I ended up going with Matt’s suggestion. The patch has been merged.

1 Like

Matt’s solution seems correct/practical. But perhaps those PriorityLevelType enums should be renamed (with old ones kept as deprecated?). Though the ‘ITK Coding Style Guide’ strangely seems to not include the word ‘enum’, it does say CamelCase is preferred, so it seems an ITK class should not have an enum named “DEBUG” at all…

Sean

This class is rarely used. And renaming the enums will bring a change which will require some time to adapt to in user code. And for little benefit.