From 12c1acde76683108441827ae9affba1872f3afe5 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 19 Apr 2011 10:39:31 -0700 Subject: 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. --- lib/libspl/Makefile.in | 9 +++++---- lib/libspl/asm-generic/Makefile.in | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'lib/libspl') diff --git a/lib/libspl/Makefile.in b/lib/libspl/Makefile.in index 7e1bc6d5a..e9f98817a 100644 --- a/lib/libspl/Makefile.in +++ b/lib/libspl/Makefile.in @@ -361,10 +361,11 @@ DEFAULT_INCLUDES = -include ${top_builddir}/zfs_config.h \ -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) SUBDIRS = include $(TARGET_ASM_DIR) DIST_SUBDIRS = include asm-generic asm-i386 asm-x86_64 AM_CCASFLAGS = \ diff --git a/lib/libspl/asm-generic/Makefile.in b/lib/libspl/asm-generic/Makefile.in index b49f38c4f..22f975042 100644 --- a/lib/libspl/asm-generic/Makefile.in +++ b/lib/libspl/asm-generic/Makefile.in @@ -259,9 +259,10 @@ DEFAULT_INCLUDES = -include ${top_builddir}/zfs_config.h \ -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\" + -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\" atomic_SOURCE = atomic.c atomic_ASM = atomic.S COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ -- cgit v1.2.3