From 53a3b39da1241ba43f63f1515f6ef5167b182cae Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 2 Jun 2016 09:46:12 -0400 Subject: Add -Wmissing-variable-declarations, with attendant fixes This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests. --- src/test/test-memwipe.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/test/test-memwipe.c') diff --git a/src/test/test-memwipe.c b/src/test/test-memwipe.c index 5e89534db6..c28d5054a2 100644 --- a/src/test/test-memwipe.c +++ b/src/test/test-memwipe.c @@ -14,6 +14,7 @@ static unsigned fill_heap_buffer_memwipe(void) __attribute__((noinline)); static unsigned fill_heap_buffer_nothing(void) __attribute__((noinline)); static unsigned check_a_buffer(void) __attribute__((noinline)); +extern const char *s; /* Make the linkage global */ const char *s = NULL; #define BUF_LEN 2048 -- cgit v1.2.3-54-g00ecf