diff options
author | Donald Sharp <donaldsharp72@gmail.com> | 2024-05-07 22:00:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 22:00:53 +0200 |
commit | 190f8baa7b898511c6757aede6ac0a8acbb9d2a3 (patch) | |
tree | c92a1b480eb77927f4e6026d596a69cd98c078cc /configure.ac | |
parent | Merge pull request #15947 from anlancs/isisd/fix-lsp-json (diff) | |
parent | build: get rid of "unrecognized … anon-tag" (diff) | |
download | frr-190f8baa7b898511c6757aede6ac0a8acbb9d2a3.tar.xz frr-190f8baa7b898511c6757aede6ac0a8acbb9d2a3.zip |
Merge pull request #15885 from opensourcerouting/gcc-unrecognized-ms-anon-tag
build: get rid of "unrecognized … anon-tag"
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 71c3d5afa..cad8ea12c 100644 --- a/configure.ac +++ b/configure.ac @@ -275,7 +275,16 @@ AC_DEFUN([AC_C_FLAG], [{ AC_CACHE_CHECK([[whether $CC supports $1]], cachename, [ AC_LANG_PUSH([C]) ac_c_flag_save="$CFLAGS" - CFLAGS="$CFLAGS $1" + dnl GCC ignores unknown -Wno-whatever flags, but errors on -Wwhatever + dnl except when it ignores them it prints: + dnl cc1: note: unrecognized command-line option ‘-Wno-whatever’ may have been intended to silence earlier diagnostics + dnl which is annoying as hell. So check for the positive flag instead. + flag_add="$1" + if test "$flag_add" != "${flag_add#-Wno-}"; then + CFLAGS="$CFLAGS -W${flag_add#-Wno-}" + else + CFLAGS="$CFLAGS $flag_add" + fi AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[$4]])], [ |