[PATCH 3/7] configure.ac: fix attribute checks

Jussi Kivilinna jussi.kivilinna at iki.fi
Wed Jan 25 22:15:20 CET 2017


* configure.ac: Add -Werror flag for attribute checks.
--

Compilter ignores unknown attributes and just shows warning. Therefore
attribute checks need to be run with -Werror.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 0 files changed

diff --git a/configure.ac b/configure.ac
index d2b863c..bc5bed4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -958,6 +958,12 @@ if test "$gcry_cv_visibility_attribute" = "yes" \
 fi
 
 
+# Following attribute tests depend on warnings to cause compile to fail,
+# so set -Werror temporarily.
+_gcc_cflags_save=$CFLAGS
+CFLAGS="$CFLAGS -Werror"
+
+
 #
 # Check whether the compiler supports the GCC style aligned attribute
 #
@@ -1009,6 +1015,10 @@ if test "$gcry_cv_gcc_attribute_may_alias" = "yes" ; then
 fi
 
 
+# Restore flags.
+CFLAGS=$_gcc_cflags_save;
+
+
 #
 # Check whether the compiler supports 'asm' or '__asm__' keyword for
 # assembler blocks.




More information about the Gcrypt-devel mailing list