Skip to content

Commit

Permalink
Avoid compile error on macos mojave
Browse files Browse the repository at this point in the history
Fixing the following error by adding the number of items in
'enum feerate' to the end of it.

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
  • Loading branch information
Moller40 committed Sep 8, 2020
1 parent 62f80f7 commit 072cebe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lightningd/chaintopology.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ const char *feerate_name(enum feerate feerate)
case FEERATE_PENALTY: return "penalty";
case FEERATE_MIN: return "min_acceptable";
case FEERATE_MAX: return "max_acceptable";
case NUM_FEERATES: break;
}
abort();
}
Expand Down
2 changes: 1 addition & 1 deletion lightningd/chaintopology.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ enum feerate {
FEERATE_PENALTY,
FEERATE_MIN,
FEERATE_MAX,
NUM_FEERATES
};
#define NUM_FEERATES (FEERATE_MAX+1)

/* We keep the last three in case there are outliers (for min/max) */
#define FEE_HISTORY_NUM 3
Expand Down

0 comments on commit 072cebe

Please sign in to comment.