aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-05-06 16:47:03 -0400
committerNick Mathewson <nickm@torproject.org>2020-05-06 16:47:03 -0400
commitd04b708b4bd47ee8df6796f19b25f558b2b18e91 (patch)
tree3eb744174d8e923fed56b4714244b94ed70c94b9 /configure.ac
parentbbfc498e21c9854b16b0543bf3f3f4ac304711f7 (diff)
parent28f453c4764962394bf0cd3a314b2b60af7ee1b4 (diff)
downloadtor-d04b708b4bd47ee8df6796f19b25f558b2b18e91.tar.gz
tor-d04b708b4bd47ee8df6796f19b25f558b2b18e91.zip
Merge branch 'maint-0.4.1' into maint-0.4.2
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 21b55d79c4..29bea66d00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -385,6 +385,22 @@ if test "$tor_cv_c_c99_designated_init" != "yes"; then
AC_MSG_ERROR([Your compiler doesn't support c99 designated initializers. This is required as of Tor 0.2.6.x])
fi
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Werror"
+AC_CACHE_CHECK([for __attribute__((fallthrough))],
+ tor_cv_c_attr_fallthrough,
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([extern int x; void fn(void) ;],
+ [[ switch (x) { case 1: fn(); __attribute__((fallthrough));
+ case 2: fn(); break; } ]])],
+ [tor_cv_c_attr_fallthrough=yes],
+ [tor_cv_c_attr_fallthrough=no] )])
+CFLAGS="$saved_CFLAGS"
+
+if test "$tor_cv_c_attr_fallthrough" == "yes"; then
+ AC_DEFINE(HAVE_ATTR_FALLTHROUGH, [1], [defined if we have the fallthrough attribute.])
+fi
+
TORUSER=_tor
AC_ARG_WITH(tor-user,
AS_HELP_STRING(--with-tor-user=NAME, [specify username for tor daemon]),