summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-30 08:17:25 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-30 08:17:25 -0400
commit33d80123ce644cfedcd283ab7f764a84e9f8d930 (patch)
treed41b69ed15bbbf0a63bb9e7293c2970f3f6b4812
parenta1402bac344905ba3cd9fddac58ac2af0940f930 (diff)
parentd102e9c2e4ab5dfca0c03f7b4e27431d069338fd (diff)
downloadtor-33d80123ce644cfedcd283ab7f764a84e9f8d930.tar.gz
tor-33d80123ce644cfedcd283ab7f764a84e9f8d930.zip
Merge branch 'maint-0.3.4' into release-0.3.4
-rw-r--r--changes/bug267854
-rw-r--r--configure.ac3
-rw-r--r--src/common/compress_zstd.c4
3 files changed, 11 insertions, 0 deletions
diff --git a/changes/bug26785 b/changes/bug26785
new file mode 100644
index 0000000000..e6392fcbdd
--- /dev/null
+++ 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
index 4f930ca619..7f9ae48c97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2296,6 +2296,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/common/compress_zstd.c b/src/common/compress_zstd.c
index 316a3fb417..dc8b4d621d 100644
--- a/src/common/compress_zstd.c
+++ b/src/common/compress_zstd.c
@@ -26,10 +26,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;