[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Fix a bug in the old-gcc version of ENABLE_GCC_WARNING
commit 60997a00e8e7585e076c750ab37095c0bfc3c773
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Thu Aug 11 19:58:13 2016 -0400
Fix a bug in the old-gcc version of ENABLE_GCC_WARNING
Fixes bug 19901; bugfix on 0.2.9.1-alpha.
---
changes/bug19901 | 5 +++++
src/common/compat.h | 14 +++++++-------
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/changes/bug19901 b/changes/bug19901
new file mode 100644
index 0000000..97bca06
--- /dev/null
+++ b/changes/bug19901
@@ -0,0 +1,5 @@
+ o Minor bugfixes (compilation):
+v - Fix a compilation warning on GCC versions before 4.6. Our
+ ENABLE_GCC_WARNING macro used the word "warning" as an
+ argument, when it is also required as an argument to the
+ compiler pragma. Fixes bug 19901; bugfix on 0.2.9.1-alpha.
diff --git a/src/common/compat.h b/src/common/compat.h
index 54ab8b0..40bcb26 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -104,17 +104,17 @@
# endif
# if defined(__clang__) || GCC_VERSION >= 406
/* we have push/pop support */
-# define DISABLE_GCC_WARNING(warning) \
+# define DISABLE_GCC_WARNING(warningopt) \
PRAGMA_DIAGNOSTIC_(push) \
- PRAGMA_DIAGNOSTIC_(ignored PRAGMA_JOIN_STRINGIFY_(-W,warning))
-# define ENABLE_GCC_WARNING(warning) \
+ PRAGMA_DIAGNOSTIC_(ignored PRAGMA_JOIN_STRINGIFY_(-W,warningopt))
+# define ENABLE_GCC_WARNING(warningopt) \
PRAGMA_DIAGNOSTIC_(pop)
# else
/* older version of gcc: no push/pop support. */
-# define DISABLE_GCC_WARNING(warning) \
- PRAGMA_DIAGNOSTIC_(ignored PRAGMA_JOIN_STRINGIFY_(-W,warning))
-# define ENABLE_GCC_WARNING(warning) \
- PRAGMA_DIAGNOSTIC_(warning PRAGMA_JOIN_STRINGIFY_(-W,warning))
+# define DISABLE_GCC_WARNING(warningopt) \
+ PRAGMA_DIAGNOSTIC_(ignored PRAGMA_JOIN_STRINGIFY_(-W,warningopt))
+# define ENABLE_GCC_WARNING(warningopt) \
+ PRAGMA_DIAGNOSTIC_(warning PRAGMA_JOIN_STRINGIFY_(-W,warningopt))
# endif
#else /* ifdef __GNUC__ */
/* not gcc at all */
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits