mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
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.
This commit is contained in:
parent
8f2d2933f9
commit
4caed2424a
@ -1757,6 +1757,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
|
||||
# and these should be just fine in gcc 4.6
|
||||
CFLAGS="$CFLAGS -Wmissing-format-attribute -Wsuggest-attribute=noreturn -Wsync-nand -Wtrampolines -Wunused-but-set-parameter -Wunused-but-set-variable -Wvariadic-macros"
|
||||
CFLAGS="$CFLAGS -Wdouble-promotion"
|
||||
CFLAGS="$CFLAGS -Woverlength-strings"
|
||||
fi
|
||||
|
||||
if test "x$have_gcc47" = "xyes"; then
|
||||
|
@ -38,7 +38,15 @@
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#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
|
||||
#include "vote_descriptors.inc"
|
||||
#if GCC_VERSION >= 406
|
||||
ENABLE_GCC_WARNING(overlength-strings)
|
||||
#endif
|
||||
|
||||
#define NS_MODULE dir_handle_get
|
||||
|
||||
|
@ -16,7 +16,15 @@
|
||||
#include "test.h"
|
||||
#include "test_helpers.h"
|
||||
|
||||
#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
|
||||
#include "test_descriptors.inc"
|
||||
#if GCC_VERSION >= 406
|
||||
ENABLE_GCC_WARNING(overlength-strings)
|
||||
#endif
|
||||
|
||||
/* Return a statically allocated string representing yesterday's date
|
||||
* in ISO format. We use it so that state file items are not found to
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user