We currently define and use configuration macros as follows:
// build/src/bitcoin-build-config.h
#define HAVE_FOO 1
/* #undef HAVE_BAR */
// some source file
#include <bitcoin-build-config.h> // IWYU pragma: keep
...
#ifdef HAVE_FOO
...
#endif // HAVE_FOO
...
#ifndef HAVE_BAR
...
#endif // HAVE_BAR
This is susceptible to typos. A misspelt name, e.g. #ifdef HAVE_F0O, compiles cleanly and silently disables the guarded code. None of our tools catches it, neither the compiler with -Wundef nor the linter.