mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
Use a GCC-specific #pragma instead of GCC-specific
-Wno-uninitialized to silence a bogus warning.
This commit is contained in:
parent
f6ce63ebdb
commit
a6f43e6412
3 changed files with 5 additions and 18 deletions
13
configure.ac
13
configure.ac
|
@ -534,8 +534,6 @@ lc_CPUCORES
|
|||
# If using GCC, set some additional AM_CFLAGS:
|
||||
###############################################################################
|
||||
|
||||
Wno_uninitialized=no
|
||||
|
||||
if test "x$GCC" = xyes ; then
|
||||
echo
|
||||
echo "GCC extensions:"
|
||||
|
@ -544,15 +542,6 @@ if test "x$GCC" = xyes ; then
|
|||
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
|
||||
|
@ -608,8 +597,6 @@ if test "x$GCC" = xyes ; then
|
|||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([COND_WNO_UNINITIALIZED], test "x$Wno_uninitialized" = "xyes")
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Create the makefiles and config.h
|
||||
|
|
|
@ -44,9 +44,4 @@ endif
|
|||
|
||||
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
|
||||
|
|
|
@ -22,6 +22,11 @@
|
|||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// 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
|
||||
|
|
Loading…
Reference in a new issue