]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't disable an unsupported compiler warning
authorTaylor Yu <catalyst@torproject.org>
Thu, 26 Jul 2018 17:32:34 +0000 (12:32 -0500)
committerTaylor Yu <catalyst@torproject.org>
Thu, 26 Jul 2018 17:32:34 +0000 (12:32 -0500)
Conditionalize the pragma that temporarily disables
-Wunused-const-variable.  Some versions of gcc don't support it.  We
need to do this because of an apparent bug in some libzstd headers.
Fixes bug 26785; bugfix on 0.3.2.11.

changes/bug26785 [new file with mode: 0644]
configure.ac
src/common/compress_zstd.c

diff --git a/changes/bug26785 b/changes/bug26785
new file mode 100644 (file)
index 0000000..e6392fc
--- /dev/null
@@ -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.
index c883279a60e0781b915ecadf4fe38d567e7f951c..37a78b779d7a4910d41d5c7f19553a4c06af5f1d 100644 (file)
@@ -2143,6 +2143,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
index baa7749f0a477d957a321913bb4531da1d23857a..1a7d21d4861ae7596afdb364c5eb3a6e0b783bc2 100644 (file)
 #include "compress_zstd.h"
 
 #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;