Skip to content

Commit

Permalink
Merge pull request #15885 from opensourcerouting/gcc-unrecognized-ms-…
Browse files Browse the repository at this point in the history
…anon-tag

build: get rid of "unrecognized … anon-tag"
  • Loading branch information
donaldsharp authored May 7, 2024
2 parents 8756def + b4eb7a0 commit 190f8ba
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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]])],
[
Expand Down

0 comments on commit 190f8ba

Please sign in to comment.