[PATCH 2/5] build-sys: avoid icc warnings "ignoring unknown option"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ruediger Meier <ruediger.meier@xxxxxxxxxxx>

Our macro UL_WARN_ADD could not discover these ones:
icc: command line warning #10006: ignoring unknown option '-Wmissing-parameter-type'
icc: command line warning #10006: ignoring unknown option '-Wredundant-decls'
icc: command line warning #10006: ignoring unknown option '-Wunused-result'
icc: command line warning #10006: ignoring unknown option '-Wnested-externs'

We need to use AC_LANG_WERROR.

Signed-off-by: Ruediger Meier <ruediger.meier@xxxxxxxxxxx>
---
 m4/compiler.m4 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/m4/compiler.m4 b/m4/compiler.m4
index 062f936..058c73f 100644
--- a/m4/compiler.m4
+++ b/m4/compiler.m4
@@ -21,11 +21,18 @@ AC_DEFUN([UL_WARN_ADD], [
   m4_define([warnvarname], m4_default([$2],WARN_CFLAGS))
   AS_VAR_PUSHDEF([ul_Warn], [ul_cv_warn_$1])dnl
   AC_CACHE_CHECK([whether compiler handles $1], m4_defn([ul_Warn]), [
+    # store AC_LANG_WERROR status, then turn it on
+    save_ac_[]_AC_LANG_ABBREV[]_werror_flag="${ac_[]_AC_LANG_ABBREV[]_werror_flag}"
+    AC_LANG_WERROR
+
     ul_save_CPPFLAGS="$CPPFLAGS"
     CPPFLAGS="-Werror ${CPPFLAGS} $1"
     AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
                       [AS_VAR_SET(ul_Warn, [yes])],
                       [AS_VAR_SET(ul_Warn, [no])])
+    # restore AC_LANG_WERROR
+    ac_[]_AC_LANG_ABBREV[]_werror_flag="${save_ac_[]_AC_LANG_ABBREV[]_werror_flag}"
+
     CPPFLAGS="$ul_save_CPPFLAGS"
   ])
   AS_VAR_IF(ul_Warn, [yes], [UL_AS_VAR_APPEND(warnvarname, [" $1"])])
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux