Skip to content

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

Open

Description

@hebasto

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.

Activity

  1. victrvondoom commented on Nov 19, 2026

    @victrvondoom
  2. deleted a comment from teymory58 on Nov 21, 2026
  3. deleted a comment from teymory58 on Nov 21, 2026
  4. deleted a comment from teymory58 on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions