aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_microdesc.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-05-30 14:13:33 -0400
committerNick Mathewson <nickm@torproject.org>2016-06-11 10:11:52 -0400
commit4caed2424a449712c8ac267d521563d31536aa6a (patch)
tree262ec1efd589f9639f28c6c09d2b4ab59e1d0d03 /src/test/test_microdesc.c
parent8f2d2933f912c9952453b17b19636c26579e2323 (diff)
downloadtor-4caed2424a449712c8ac267d521563d31536aa6a.tar.gz
tor-4caed2424a449712c8ac267d521563d31536aa6a.zip
Enable -Woverlength-strings for GCC>=4.6 on MOST of the code.
IMO it's fine for us to make exceptions to this rule in the unit tests, but not in the code at large.
Diffstat (limited to 'src/test/test_microdesc.c')
-rw-r--r--src/test/test_microdesc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test_microdesc.c b/src/test/test_microdesc.c
index 581f58b45f..28c4f0706c 100644
--- a/src/test/test_microdesc.c
+++ b/src/test/test_microdesc.c
@@ -490,6 +490,11 @@ test_md_generate(void *arg)
routerinfo_free(ri);
}
+#if GCC_VERSION >= 406
+DISABLE_GCC_WARNING(overlength-strings)
+/* We allow huge string constants in the unit tests, but not in the code
+ * at large. */
+#endif
/* Taken at random from my ~/.tor/cached-microdescs file and then
* hand-munged */
static const char MD_PARSE_TEST_DATA[] =
@@ -645,6 +650,9 @@ static const char MD_PARSE_TEST_DATA[] =
"id rsa1024 2A8wYpHxnkKJ92orocvIQBzeHlE\n"
"p6 allow 80\n"
;
+#if GCC_VERSION >= 406
+ENABLE_GCC_WARNING(overlength-strings)
+#endif
/** More tests for parsing different kinds of microdescriptors, and getting
* invalid digests trackd from them. */