Set -Wno-unused-but-set-variable globally

As of gcc-4.6 the option -Wunused-but-set-variable is enabled by
default.  While this is a useful warning there are numerous places
in the ZFS code when a variable is set and then only checked in an
ASSERT().  To avoid having to update every instance of this in the
code we now set -Wno-unused-but-set-variable to suppress the warning.

Additionally, when building with --enable-debug and -Werror set these
warning also become fatal.  We can reevaluate the suppression of these
error at a later time if it becomes an issue.  For now we are basically
just reverting to the previous gcc behavior.
This commit is contained in:
Brian Behlendorf
2011-04-19 10:39:31 -07:00
parent 79713039a2
commit 12c1acde76
20 changed files with 83 additions and 62 deletions
+5 -4
View File
@@ -331,10 +331,11 @@ DEFAULT_INCLUDES = -include ${top_builddir}/zfs_config.h \
-I$(top_srcdir)/include -I$(top_srcdir)/lib/libspl/include
AM_LIBTOOLFLAGS = --silent
AM_CFLAGS = -Wall -Wstrict-prototypes -fno-strict-aliasing \
${DEBUG_CFLAGS} -D_GNU_SOURCE -D__EXTENSIONS__ -D_REENTRANT \
-D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE64_SOURCE -DTEXT_DOMAIN=\"zfs-linux-user\" \
$(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
-Wno-unused-but-set-variable ${DEBUG_CFLAGS} -D_GNU_SOURCE \
-D__EXTENSIONS__ -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS \
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
-DTEXT_DOMAIN=\"zfs-linux-user\" $(DEBUG_STACKFLAGS) \
$(FRAME_LARGER_THAN)
lib_LTLIBRARIES = libzpool.la
libzpool_la_LIBADD = \
$(top_builddir)/lib/libunicode/libunicode.la \