summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-05-06 15:18:36 -0400
committerNick Mathewson <nickm@torproject.org>2020-05-06 15:18:36 -0400
commit3e42464f5a6f8fac7651bad05f180cc1ed2ca51d (patch)
treef41f5df20de58f17abbd8b59d55ba992966b7549 /configure.ac
parenta02e866642c28b4c0cbe415f8573c4ede4d9caf7 (diff)
parent3d3641152b5d8a4bf8587dec640bda3d440b7c36 (diff)
downloadtor-3e42464f5a6f8fac7651bad05f180cc1ed2ca51d.tar.gz
tor-3e42464f5a6f8fac7651bad05f180cc1ed2ca51d.zip
Merge branch 'bug34078_prelim_035' into bug34078_prelim_041
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 628811e53e..9f784d932c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -365,6 +365,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]),