Add missing extern qualifiers for gcc 10

GCC 10 defaults to `-fno-common`. no longer automatically sharing
global variable definitions, which makes it important to define
them in only one place (otherwise there will be duplicate definition
errors). Add `extern` qualifiers where (I think) is the best place for
them.
This commit is contained in:
Wladimir J. van der Laan
2020-01-31 20:59:00 +00:00
committed by Rusty Russell
parent fd76b8bfba
commit e4c6fd89b7
9 changed files with 9 additions and 9 deletions

View File

@@ -18,8 +18,6 @@
#include <unistd.h>
#include <wally_core.h>
struct backtrace_state *backtrace_state;
#if BACKTRACE_SUPPORTED
static void (*bt_print)(const char *fmt, ...) PRINTF_FMT(1,2);
static void (*bt_exit)(void);

View File

@@ -20,6 +20,4 @@ void daemon_shutdown(void);
/* Kick in a debugger if they set --debugger */
void daemon_maybe_debug(char *argv[]);
struct backtrace_state *backtrace_state;
#endif /* LIGHTNING_COMMON_DAEMON_H */

View File

@@ -7,6 +7,8 @@
#include <common/memleak.h>
#include <common/utils.h>
struct backtrace_state *backtrace_state;
#if DEVELOPER
static bool memleak_track;

View File

@@ -66,4 +66,6 @@ void memleak_scan_region(struct htable *memtable,
/* Get (and remove) a leak from memtable, or NULL */
const void *memleak_get(struct htable *memtable, const uintptr_t **backtrace);
extern struct backtrace_state *backtrace_state;
#endif /* LIGHTNING_COMMON_MEMLEAK_H */

View File

@@ -47,7 +47,7 @@ size_t bigsize_put(u8 buf[BIGSIZE_MAX_LEN] UNNEEDED, bigsize_t v UNNEEDED)
{ fprintf(stderr, "bigsize_put called!\n"); abort(); }
/* AUTOGENERATED MOCKS END */
secp256k1_context *secp256k1_ctx;
extern secp256k1_context *secp256k1_ctx;
static struct secret secret_from_hex(const char *hex)
{

View File

@@ -104,7 +104,7 @@ static bool secret_eq_str(const struct secret *s, const char *str)
return secret_eq_consttime(s, &expect);
}
secp256k1_context *secp256k1_ctx;
extern secp256k1_context *secp256k1_ctx;
const void *trc;
static struct pubkey rs_pub, ls_pub, e_pub;
static struct privkey ls_priv, e_priv;

View File

@@ -104,7 +104,7 @@ static bool secret_eq_str(const struct secret *s, const char *str)
return secret_eq_consttime(s, &expect);
}
secp256k1_context *secp256k1_ctx;
extern secp256k1_context *secp256k1_ctx;
static struct pubkey ls_pub, e_pub;
static struct privkey ls_priv, e_priv;

View File

@@ -35,7 +35,7 @@ static size_t in_timer;
bool deprecated_apis;
const struct chainparams *chainparams;
extern const struct chainparams *chainparams;
struct plugin_timer {
struct timer timer;

View File

@@ -12,7 +12,7 @@
#include <common/sphinx.h>
#include <wire/gen_peer_wire.h>
secp256k1_context *secp256k1_ctx;
extern secp256k1_context *secp256k1_ctx;
/* AUTOGENERATED MOCKS START */
/* Generated stub for amount_asset_is_main */