[RFC] build: Configuration macro names are susceptible to typos #36874

issue hebasto opened this issue on November 14, 2026
  1. hebasto commented at 6:37 PM on November 14, 2026: member

    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.

    Related: #16419, #29876, #36023.

  2. hebasto added the label Brainstorming on Nov 14, 2026
  3. hebasto added the label Build system on Nov 14, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-11-16 00:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me