Browse Source

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.
travis-debug
Wladimir J. van der Laan 5 years ago
committed by Rusty Russell
parent
commit
e4c6fd89b7
  1. 2
      common/daemon.c
  2. 2
      common/daemon.h
  3. 2
      common/memleak.c
  4. 2
      common/memleak.h
  5. 2
      common/test/run-sphinx.c
  6. 2
      connectd/test/run-initiator-success.c
  7. 2
      connectd/test/run-responder-success.c
  8. 2
      plugins/libplugin.c
  9. 2
      wire/test/run-peer-wire.c

2
common/daemon.c

@ -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);

2
common/daemon.h

@ -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 */

2
common/memleak.c

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

2
common/memleak.h

@ -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 */

2
common/test/run-sphinx.c

@ -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)
{

2
connectd/test/run-initiator-success.c

@ -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;

2
connectd/test/run-responder-success.c

@ -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;

2
plugins/libplugin.c

@ -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;

2
wire/test/run-peer-wire.c

@ -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 */

Loading…
Cancel
Save