Skip to content

Commit b1505d7

Browse files
committed
misc: fix uninitialised errors for macOS
MacOS SDK is quite strict so treats these uninitialised variable warnings as errors.
1 parent a3a8cf2 commit b1505d7

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

common/test/run-trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
int main(int argx, char *argv[])
99
{
1010
/* Just some context objects to hang spans off of. */
11-
int a, b, c, d;
11+
int a = 0, b = 0, c = 0, d = 0;
1212

1313
common_setup(argv[0]);
1414

devtools/mkquery.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int main(int argc, char *argv[])
1717
{
1818
struct bitcoin_blkid chainhash;
1919
const tal_t *ctx = tal(NULL, char);
20-
const u8 *msg;
20+
const u8 *msg = NULL;
2121

2222
setup_locale();
2323
secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY |
@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
3636
strtol(argv[3], NULL, 0),
3737
strtol(argv[4], NULL, 0));
3838
} else if (streq(argv[1], "query_channel_range")) {
39-
struct tlv_query_channel_range_tlvs *tlvs;
39+
struct tlv_query_channel_range_tlvs *tlvs = NULL;
4040
if (argc == 5)
4141
tlvs = NULL;
4242
else if (argc == 6) {
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
5050
strtol(argv[4], NULL, 0),
5151
tlvs);
5252
} else if (streq(argv[1], "query_short_channel_ids")) {
53-
struct tlv_query_short_channel_ids_tlvs *tlvs;
53+
struct tlv_query_short_channel_ids_tlvs *tlvs = NULL;
5454
u8 *encoded;
5555

5656
if (argc == 4)

lightningd/dual_open_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,7 @@ static bool verify_option_will_fund_signature(struct peer *peer,
22542254
static void handle_validate_lease(struct subd *dualopend,
22552255
const u8 *msg)
22562256
{
2257-
const secp256k1_ecdsa_signature sig;
2257+
secp256k1_ecdsa_signature sig = {{0}};
22582258
u16 chan_fee_max_ppt;
22592259
u32 chan_fee_max_base_msat, lease_expiry;
22602260
struct pubkey their_pubkey;

openingd/dualopend.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,6 @@ static u8 *opener_commits(struct state *state,
27942794
struct amount_sat total,
27952795
char **err_reason)
27962796
{
2797-
struct channel_id cid;
27982797
struct amount_msat our_msats;
27992798
struct penalty_base *pbase;
28002799
struct bitcoin_tx *local_commit;
@@ -2853,7 +2852,7 @@ static u8 *opener_commits(struct state *state,
28532852

28542853
tal_free(state->channel);
28552854
state->channel = new_initial_channel(state,
2856-
&cid,
2855+
&state->channel_id,
28572856
&tx_state->funding,
28582857
state->minimum_depth,
28592858
take(new_height_states(NULL, LOCAL,

0 commit comments

Comments
 (0)