Skip to content
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

Avoid compile error on macos mojave #4019

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

Moller40
Copy link
Contributor

@Moller40 Moller40 commented Sep 8, 2020

Fixing the following error by changing 'enum feerate' to int.

lightningd/bitcoind.c:183:29: error: result of comparison of constant 8 with expression of type 'enum feerate' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
for (enum feerate f = 0; f < NUM_FEERATES; f++) {

@rustyrussell
Copy link
Contributor

No, the compiler is wrong here. (It's true for C++, not C).

My preferred fix is to change f to an int, i.e.:

for (int f = 0; f < NUM_FEERATES; f++) {

Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please just change f to an int, check if that fixes compile?

@rustyrussell rustyrussell added this to the v0.9.1 milestone Sep 8, 2020
Fixing the following error by changing 'enum feerate' to int.

lightningd/bitcoind.c:183:29: error: result of comparison of constant
8 with expression of type 'enum feerate' is always true [-Werror,
-Wtautological-constant-out-of-range-compare]
        for (enum feerate f = 0; f < NUM_FEERATES; f++) {

Changelog-Fixed: compile error on macos
@Moller40
Copy link
Contributor Author

Moller40 commented Sep 9, 2020

Yes, changing f to an int also fixes it.

@cdecker
Copy link
Member

cdecker commented Sep 9, 2020

ACK ea61f48

@rustyrussell rustyrussell merged commit 4d67207 into ElementsProject:master Sep 9, 2020
@rustyrussell
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants