From: Nick Mathewson Date: Thu, 2 Jun 2016 14:05:03 +0000 (-0400) Subject: Add clang's -Wstring-conversion, and fix the one place it hits X-Git-Tag: tor-0.2.9.1-alpha~183^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e80a032b61e3c793ad0d1627074b8750f7cfec48;p=thirdparty%2Ftor.git Add clang's -Wstring-conversion, and fix the one place it hits --- diff --git a/configure.ac b/configure.ac index 85ba939a87..79457372f7 100644 --- a/configure.ac +++ b/configure.ac @@ -1851,6 +1851,7 @@ if test "x$enable_gcc_warnings_advisory" != "xno"; then -Wstatic-local-in-inline -Wstrict-overflow=2 -Wstring-compare + -Wstring-conversion -Wstrlcpy-strlcat-size -Wstrncat-size -Wsuggest-attribute=format diff --git a/src/test/test_relaycell.c b/src/test/test_relaycell.c index 1cd9ff064b..fb6748965a 100644 --- a/src/test/test_relaycell.c +++ b/src/test/test_relaycell.c @@ -95,7 +95,7 @@ test_relaycell_resolved(void *arg) tt_int_op(srm_ncalls, OP_EQ, 1); \ tt_ptr_op(srm_conn, OP_EQ, entryconn); \ tt_int_op(srm_atype, OP_EQ, (atype)); \ - if (answer) { \ + if ((answer) != NULL) { \ tt_int_op(srm_alen, OP_EQ, sizeof(answer)-1); \ tt_int_op(srm_alen, OP_LT, 512); \ tt_int_op(srm_answer_is_set, OP_EQ, 1); \