summaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-06-02 09:46:12 -0400
committerNick Mathewson <nickm@torproject.org>2016-06-11 10:11:54 -0400
commit53a3b39da1241ba43f63f1515f6ef5167b182cae (patch)
tree558ec394f3a02bb8f2b5e887ff70b82231424143 /src/ext
parent80f1a2cbbdd0abd509711a5069f31855df5bcd79 (diff)
downloadtor-53a3b39da1241ba43f63f1515f6ef5167b182cae.tar.gz
tor-53a3b39da1241ba43f63f1515f6ef5167b182cae.zip
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.
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/ed25519/donna/ed25519-donna-batchverify.h2
-rw-r--r--src/ext/tinytest.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/ext/ed25519/donna/ed25519-donna-batchverify.h b/src/ext/ed25519/donna/ed25519-donna-batchverify.h
index 43c4923b3e..7c64cce787 100644
--- a/src/ext/ed25519/donna/ed25519-donna-batchverify.h
+++ b/src/ext/ed25519/donna/ed25519-donna-batchverify.h
@@ -188,7 +188,7 @@ ge25519_multi_scalarmult_vartime(ge25519 *r, batch_heap *heap, size_t count) {
}
/* not actually used for anything other than testing */
-unsigned char batch_point_buffer[3][32];
+static unsigned char batch_point_buffer[3][32];
static int
ge25519_is_neutral_vartime(const ge25519 *p) {
diff --git a/src/ext/tinytest.c b/src/ext/tinytest.c
index f6baeeb9a5..3fb1b39c71 100644
--- a/src/ext/tinytest.c
+++ b/src/ext/tinytest.c
@@ -69,15 +69,16 @@ static int n_skipped = 0; /**< Number of tests that have been skipped. */
static int opt_forked = 0; /**< True iff we're called from inside a win32 fork*/
static int opt_nofork = 0; /**< Suppress calls to fork() for debugging. */
static int opt_verbosity = 1; /**< -==quiet,0==terse,1==normal,2==verbose */
-const char *verbosity_flag = "";
+static const char *verbosity_flag = "";
-const struct testlist_alias_t *cfg_aliases=NULL;
+static const struct testlist_alias_t *cfg_aliases=NULL;
enum outcome { SKIP=2, OK=1, FAIL=0 };
static enum outcome cur_test_outcome = 0;
-const char *cur_test_prefix = NULL; /**< prefix of the current test group */
+/** prefix of the current test group */
+static const char *cur_test_prefix = NULL;
/** Name of the current test, if we haven't logged is yet. Used for --quiet */
-const char *cur_test_name = NULL;
+static const char *cur_test_name = NULL;
#ifdef _WIN32
/* Copy of argv[0] for win32. */