2 dnl # Check if gcc supports -Wno-unused-but-set-variable option.
4 dnl # We actually invoke gcc with the -Wunused-but-set-variable option
5 dnl # and infer the 'no-' version does or doesn't exist based upon
6 dnl # the results. This is required because when checking any of
7 dnl # no- prefixed options gcc always returns success.
9 AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE], [
10 AC_MSG_CHECKING([for -Wno-unused-but-set-variable support])
13 CFLAGS="$CFLAGS -Wunused-but-set-variable"
15 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
17 NO_UNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable
21 NO_UNUSED_BUT_SET_VARIABLE=
26 AC_SUBST([NO_UNUSED_BUT_SET_VARIABLE])