mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-21 12:20:43 +02:00
bulid: merge branch 'th/autotools-fix-detect-compiler-warning'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1334
This commit is contained in:
commit
082e6c96a1
2 changed files with 10 additions and 1 deletions
|
|
@ -1114,7 +1114,7 @@ fi
|
|||
|
||||
NM_COMPILER_WARNINGS(AM_CFLAGS, ${more_warnings_default})
|
||||
|
||||
NM_COMPILER_FLAG(LIBSYSTEMD_NM_CFLAGS, "-Wno-gnu-variable-sized-type-not-at-end")
|
||||
NM_COMPILER_WARNING_FLAG(LIBSYSTEMD_NM_CFLAGS, "-Wno-gnu-variable-sized-type-not-at-end")
|
||||
AC_SUBST(LIBSYSTEMD_NM_CFLAGS)
|
||||
|
||||
CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
|
||||
|
|
|
|||
|
|
@ -29,8 +29,17 @@ AC_DEFUN([NM_COMPILER_FLAG], [
|
|||
], [$4])
|
||||
])
|
||||
|
||||
dnl Check whether a particular warning is supported. If yes, the flag
|
||||
dnl is appended to [ENV-VAR].
|
||||
dnl NM_COMPILER_WARNING_FLAG([ENV-VAR], [WARNING])
|
||||
AC_DEFUN([NM_COMPILER_WARNING_FLAG], [
|
||||
dnl "-Wno-*" requires special handling, see https://gcc.gnu.org/wiki/FAQ#wnowarning.
|
||||
_NM_COMPILER_FLAG([-Wall $(printf '%s' "$2" | sed -e 's/^-W\(no-\|no-error=\)/-W/')], [], [eval "AS_TR_SH([$1])='$$1 $2'"], [])
|
||||
])
|
||||
|
||||
dnl Check whether a particular warning is not emitted with code provided,
|
||||
dnl append an option to disable the warning to a specified variable if the check fails.
|
||||
dnl Note that this always either adds -W$2 or -Wno-$2, depending on whether it's supported.
|
||||
dnl NM_COMPILER_WARNING([ENV-VAR], [WARNING], [C-SNIPPET])
|
||||
AC_DEFUN([NM_COMPILER_WARNING], [
|
||||
_NM_COMPILER_FLAG([-W$2], [$3], [eval "AS_TR_SH([$1])='$$1 -W$2'"], [eval "AS_TR_SH([$1])='$$1 -Wno-$2'"])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue