tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 5823e62fa2a83fb1f7a27c82be930749e3a4782d
parent 9ae35975402a823a420cd5efb81a1c3a76f6c4d6
Author: Nick Mathewson <nickm@torproject.org>
Date:   Mon, 30 Jul 2018 08:17:25 -0400

Merge branch 'maint-0.3.4'

Diffstat:
Achanges/bug26785 | 4++++
Mconfigure.ac | 3+++
Msrc/lib/compress/compress_zstd.c | 4++++
3 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/changes/bug26785 b/changes/bug26785 @@ -0,0 +1,4 @@ + o Minor bugfixes (compilation, portability): + - Don't try to use a pragma to temporarily disable + -Wunused-const-variable if the compiler doesn't support it. + Fixes bug 26785; bugfix on 0.3.2.11. diff --git a/configure.ac b/configure.ac @@ -2253,6 +2253,9 @@ dnl -Wthread-safety-precise if test "$tor_cv_cflags__Woverlength_strings" = "yes"; then AC_DEFINE([HAVE_CFLAG_WOVERLENGTH_STRINGS], 1, [True if we have -Woverlength-strings]) fi + if test "$tor_cv_cflags__warn_unused_const_variable_2" = "yes"; then + AC_DEFINE([HAVE_CFLAG_WUNUSED_CONST_VARIABLE], 1, [True if we have -Wunused-const-variable]) + fi if test "x$enable_fatal_warnings" = "xyes"; then # I'd like to use TOR_CHECK_CFLAGS here, but I can't, since the diff --git a/src/lib/compress/compress_zstd.c b/src/lib/compress/compress_zstd.c @@ -28,10 +28,14 @@ #endif #ifdef HAVE_ZSTD +#ifdef HAVE_CFLAG_WUNUSED_CONST_VARIABLE DISABLE_GCC_WARNING(unused-const-variable) +#endif #include <zstd.h> +#ifdef HAVE_CFLAG_WUNUSED_CONST_VARIABLE ENABLE_GCC_WARNING(unused-const-variable) #endif +#endif /** Total number of bytes allocated for Zstandard state. */ static atomic_counter_t total_zstd_allocation;