#36023 build: Always define HAVE_SYSTEM
https://github.com/bitcoin/bitcoin/pull/36023 · · +1/-1 in 1 files, 1 commits · labels: Build system
Goal
- Silence compiler warnings on platforms lacking std::system such as iOS
- Clean up build logs for developers targeting platforms without std::system
Switches the CMake definition of HAVE_SYSTEM in bitcoin-build-config.h.in from #cmakedefine to #cmakedefine01. This ensures HAVE_SYSTEM is always defined as either 1 or 0 instead of being left undefined when std::system is absent.
Problem: When compiling on platforms lacking std::system (such as iOS), an undefined HAVE_SYSTEM triggers -Wundef compiler warnings at #if HAVE_SYSTEM check sites.
Category: Build and CI (#47 of 55)
P4 · platform fix
- P4 because it only fixes minor compiler warnings on a non-primary platform like iOS
- It does not fix any build failures on supported platforms
P4 because it fixes a minor compiler warning (-Wundef) on a non-primary platform (iOS) without fixing any supported platform build failure. Author noted: 'When this feature is unavailable, #cmakedefine leaves its macro undefined, triggering -Wundef. I noticed this while building the kernel for iOS.'
Membership: Modifies cmake/bitcoin-build-config.h.in.
Factors: security/stability 0, bug 0, performance 0, user value 1, leverage 0
Reviewability: Ready
- Ready to review
- The patch is minimal and clean with no open blockers
The patch is minimal and clean, with no open blockers preventing review of the current commit.
Author status: active, last responded on 2026-08-19 explaining preference for #cmakedefine01 over #if defined
Open concerns:
- Reviewers questioned ad-hoc changes to header definitions and suggested either reverting call sites to use #if defined(...) or establishing a project-wide convention enforced by a linter (fanquake, hebasto, maflcko).
Resolved concerns:
- Author dropped a simultaneous modification to HAVE_FDATASYNC after feedback.
Agreement: Mild
- Skeptical of ad-hoc macro changes without a project-wide convention (fanquake, hebasto, maflcko)
- Suggested reverting check sites instead of altering cmake definitions (hebasto)
- Suggested establishing and enforcing a global macro standard via linter (maflcko)
Mild skepticism over ad-hoc cmake macro style without broader conventions (fanquake, hebasto, maflcko).
Maintainers pushed back against one-off macro alterations without a unified style or lint rule, though no outright concept NACK was maintained after the author trimmed the PR.
- fanquake objected to random macro changes: 'Please don't make random changes for no reason.'
- hebasto suggested handling it at call sites: 'Maybe simply revert 976b034b13d28877aee641833d5ee28a8cc5d83f?'
- maflcko asked whether a consistent macro style should be enforced globally via a linter.
Review verdicts (DrahtBot): 0
Files
0 lines under test/bench/ci.
- cmake/bitcoin-build-config.h.in +1/-1
Card
Changes the CMake build configuration for HAVE_SYSTEM to use #cmakedefine01 so it is always defined as 0 or 1. This prevents -Wundef warnings when building the kernel on platforms lacking std::system, such as iOS. Initial reviewer feedback questioned making ad-hoc macro changes without a consistent style or linter. The patch is small and ready for review.