# If using GCC, set some additional AM_CFLAGS:
###############################################################################
-Wno_uninitialized=no
-
if test "x$GCC" = xyes ; then
echo
echo "GCC extensions:"
AM_CFLAGS="$AM_CFLAGS $CFLAG_VISIBILITY"
fi
- # -Wno-uninitialized is needed with -Werror with SHA256 code
- # to omit a bogus warning.
- AC_MSG_CHECKING([if $CC accepts -Wno-uninitialized])
- OLD_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Wno-uninitialized"
- AC_COMPILE_IFELSE([void foo(void) { }], [Wno_uninitialized=yes])
- CFLAGS="$OLD_CFLAGS"
- AC_MSG_RESULT([$Wno_uninitialized])
-
# Enable as much warnings as possible. These commented warnings won't
# work for this package though:
# * -Wunreachable-code breaks several assert(0) cases, which are
fi
fi
-AM_CONDITIONAL([COND_WNO_UNINITIALIZED], test "x$Wno_uninitialized" = "xyes")
-
###############################################################################
# Create the makefiles and config.h
if COND_CHECK_SHA256
libcheck_la_SOURCES += sha256.c
-# Hide bogus warning to allow usage of -Werror. If more issues like this
-# pop up, we'll drop -Werror.
-if COND_WNO_UNINITIALIZED
-AM_CFLAGS += -Wno-uninitialized
-endif
endif
//
///////////////////////////////////////////////////////////////////////////////
+// Avoid bogus warnings in transform().
+#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) || __GNUC__ > 4
+# pragma GCC diagnostic ignored "-Wuninitialized"
+#endif
+
#include "check.h"
#ifndef WORDS_BIGENDIAN