-
Notifications
You must be signed in to change notification settings - Fork 35.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: Check usages of #if defined(...) #25302
Conversation
The linting failed because of |
Yes, it's not possible to make changes to subtrees through a PR in this repository, it needs to go through the appropriate upstream. |
I see, thank you for the information. I have reverted the files for secp256k1. |
You need to remove the changes entirely, no reversion commits. You'll also need to write a proper / useful commit message for the actual change. I'd suggest reading through https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md. |
e672edd
to
8a4a796
Compare
Sorry about that, I've published a new change which I hope corrects my mistakes. |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
AC_DEFINE only defines if it's actually called. Conditional calls to AC_DEFINE (such as those setting it to a constant
|
Correction: LevelDB is using |
With that said I think I've missunderstood the task? Should I remove all my previous changes and perhaps only address what you mentioned with |
No, that issue has now been resolved in master. However you can rebase / squash your changes here. |
@brokenprogrammer interested in following? |
@fanquake So the changes are fine and what is left is simply to merge latest master and squash the changes? |
@brokenprogrammer sorry for not following up. Changes should always be squashed. I will get to reviewing this shortly. |
#if defined(HAVE_CONSENSUS_LIB) | ||
#if HAVE_CONSENSUS_LIB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditional calls to AC_DEFINE (such as those setting it to a constant
1
, or not setting a value at all) needdefined()
/#ifdef
AIUI
Agree with @luke-jr.
In this particular case, it is conditional:
Lines 1707 to 1710 in 8126551
if test "$build_bitcoin_libs" = "yes"; then | |
AC_DEFINE([HAVE_CONSENSUS_LIB], [1], [Define this symbol if the consensus lib has been built]) | |
AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in]) | |
fi |
therefore, the current code (in the master branch) is fine.
6efd69a
to
d204332
Compare
@fanquake No worries, I've squashed and updated the commit message according to the contributing guidelines. |
A #25302 (comment) still needs to be addressed. |
UPD. False suggestion. Sorry. |
@@ -604,7 +604,7 @@ std::string SHA256AutoDetect() | |||
have_x86_shani = (ebx >> 29) & 1; | |||
} | |||
|
|||
#if defined(ENABLE_X86_SHANI) && !defined(BUILD_BITCOIN_INTERNAL) | |||
#if ENABLE_X86_SHANI && !defined(BUILD_BITCOIN_INTERNAL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is only defined conditionally:
https://github.com/bitcoin/bitcoin/blob/master/configure.ac#L569-L581
Edit: Sorry, I think I made a mistake here.
And another edit: I think I confused myself here. Shouldn't any variable that is not defined in config.status with either a "0" or "1" be checked with #if defined(...)
?
🐙 This pull request conflicts with the target branch and needs rebase. |
I've re-reviewed this PR and none of the suggested changes seem required to me. More details see in #16419 (comment). |
Going to close for now. We can continue any discussion in #16419. |
…MQ is not available fa5831b build: Do not define `ENABLE_ZMQ` when ZMQ is not available (Hennadii Stepanov) Pull request description: A new behavior is consistent with the other optional dependencies. The source code contains `#if ENABLE_ZMQ` lines only: ``` $ git grep ENABLE_ZMQ -- src/*.cpp src/init.cpp:#if ENABLE_ZMQ src/init.cpp:#if ENABLE_ZMQ src/init.cpp:#if ENABLE_ZMQ src/init.cpp:#if ENABLE_ZMQ src/init.cpp:#if ENABLE_ZMQ ``` Change in description line -- "Define to 1..." --> "Define this symbol.." -- is motivated by the fact that the actual value of the defined `ENABLE_ZMQ` macro does not matter at all. Related to: - bitcoin/bitcoin#16419 - bitcoin/bitcoin#25302 ACKs for top commit: TheCharlatan: ACK fa5831b jarolrod: ACK fa5831b Tree-SHA512: 5e72ff0d34c4b33205338daea0aae8d7aa0e48fd633e21af01af32b7ddb0532ef68dd3dd74deb2c1d2599691929617e8c09676bcbaaf7d669b88816f866f1db2
I tried to go over #16419.
Based on #16344 I interpreted that the AC_DEFINE like the following:
Results in value defines which also #16547 suggests.
If I've missunderstood anything or if there is more
#if defined
or#ifdef
that should be#if
then please let me know and I will update the pull request.