ID:2482197
Jun 28 2019, 8:18 pm
|
|||||||
| |||||||
We have warnings for unused variables but I don't believe we have warnings for unused defines. Is there any reason we don't?
|
Jun 28 2019, 9:04 pm
|
|
Unused defines are inconsequential. And sometimes intentional.
|
Inconsequentially.
Also basically every general purpose library would generate a huge number of warnings especially when naming bitflags using #defines, and forward-thinking stuff like utility macros. |
defines are a stack, this is a feature that can be used intentionally for code maintenance benefits between modules or libraries.
#define blah "foo" When it comes to preventing namespace collision, this allows modules or libraries to not worry about conflicting with a define by the main code by just unsetting it at the end. Even if the main code defined the define before the module/library, it's value will be preserved. |