summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2017-01-30 12:17:25 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2017-02-01 14:10:44 +0100
commit2e505786d6d9d537f5b6631099862f6b93e2e687 (patch)
treedb4e316a409e6578c6fc4792116ecc4a8ab807ff /configure.ac
parentc369b062182c746849196e495db467198039edf4 (diff)
downloadsssd-2e505786d6d9d537f5b6631099862f6b93e2e687.tar.gz
sssd-2e505786d6d9d537f5b6631099862f6b93e2e687.tar.xz
sssd-2e505786d6d9d537f5b6631099862f6b93e2e687.zip
Suppres implicit-fallthrough from gcc 7
Some kind of comments are recognized by gcc7 but they are ignored with -Wimplicit-fallthrough=5 and only attributes disable the warning. Reviewed-by: Fabiano FidĂȘncio <fidencio@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 291504652..d264abf3e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -418,6 +418,30 @@ if test x"$sss_cv_attribute_warn_unused_result" = xyes ; then
[whether compiler supports __attribute__((warn_unused_result))])
fi
+SAFE_CFLAGS=$CFLAGS
+CFLAGS="-Werror"
+AC_CACHE_CHECK(
+ [whether compiler supports __attribute__((fallthrough))],
+ [sss_cv_attribute_fallthrough],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [ __attribute__ ((fallthrough)); ])
+ ],[
+ sss_cv_attribute_fallthrough=yes
+ sss_cv_attribute_fallthrough_val="__attribute__ ((fallthrough))"
+ ],[
+ sss_cv_attribute_fallthrough=no
+ sss_cv_attribute_fallthrough_val=
+ ])
+ ])
+CFLAGS=$SAFE_CFLAGS
+
+AC_DEFINE_UNQUOTED(
+ [SSS_ATTRIBUTE_FALLTHROUGH],
+ [$sss_cv_attribute_fallthrough_val],
+ [__attribute__((fallthrough)) if supported])
+
+
PKG_CHECK_MODULES([CHECK], [check >= 0.9.5], [have_check=1], [have_check=])
if test x$have_check = x; then
AC_MSG_WARN([Without the 'CHECK' libraries, you will be unable to run all tests in the 'make check' suite])