Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process. |
Please don't make random changes for no reason. |
|
Maybe simply revert 976b034? |
|
Ref: #16419 Can we not use a single style and enforce it with a linter, similar to the |
b53a664 to
34a3159
Compare
When this feature is unavailable, #cmakedefine leaves its macro undefined, triggering -Wundef. Use #cmakedefine01 to always generate 0 or 1.
34a3159 to
013fffe
Compare
|
The change seems fine to me, but it would be nice to be consistent across these definitions. |
Is this concern aesthetic or technical? However, I agree that using
In this case, it does not change behavior when The problem of detecting misused directives in the source code remains for
The current usage is not uniform either. For example, here are the different patterns for configuration macro definitions:
$ git grep '#cmakedefine ' -- cmake/bitcoin-build-config.h.in | wc -l
18
$ git grep '#cmakedefine01' -- cmake/bitcoin-build-config.h.in | wc -l
4
This approach gives us free protection against a misspelled macro name, which will trigger the Here are some useful external resources:
Bottom line: I agree with this PR change. I'd really like to see here a new linter check that prevents accidental misuse of |
Aesthetics, but in the sense that it's more clear: This only works if we consistently use |

When this feature is unavailable,
#cmakedefineleaves its macro undefined, triggering-Wundef. I noticed this while building the kernel for iOs.Use
#cmakedefine01to always generate 0 or 1.