3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00
iwd/acinclude.m4
Denis Kenzior 8465dddcab build: Drop Werror=variadic-macros
The following commit:
80db8fd86c ("build: Use -Wvariadic-macros warning")
added a warning about variadic-macros.  But it isn't quite clear why
since variadic macros are used throghout iwd.  GCC doesn't honor this
option, but clang does.  Since there's no real reason to stop using
variadic macros at this time, drop this warning.
2023-04-13 22:20:58 -05:00

72 lines
1.8 KiB
Plaintext

AC_DEFUN([AC_PROG_CC_PIE], [
AC_CACHE_CHECK([whether ${CC-cc} accepts -fPIE], ac_cv_prog_cc_pie, [
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -fPIE -pie -c conftest.c 2>&1`"; then
ac_cv_prog_cc_pie=yes
else
ac_cv_prog_cc_pie=no
fi
rm -rf conftest*
])
])
AC_DEFUN([AC_PROG_CC_ASAN], [
AC_CACHE_CHECK([whether ${CC-cc} accepts -fsanitize=address], ac_cv_prog_cc_asan, [
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -fsanitize=address -c conftest.c 2>&1`"; then
ac_cv_prog_cc_asan=yes
else
ac_cv_prog_cc_asan=no
fi
rm -rf conftest*
])
])
AC_DEFUN([AC_PROG_CC_LSAN], [
AC_CACHE_CHECK([whether ${CC-cc} accepts -fsanitize=leak], ac_cv_prog_cc_lsan, [
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -fsanitize=leak -c conftest.c 2>&1`"; then
ac_cv_prog_cc_lsan=yes
else
ac_cv_prog_cc_lsan=no
fi
rm -rf conftest*
])
])
AC_DEFUN([AC_PROG_CC_UBSAN], [
AC_CACHE_CHECK([whether ${CC-cc} accepts -fsanitize=undefined], ac_cv_prog_cc_ubsan, [
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -fsanitize=undefined -c conftest.c 2>&1`"; then
ac_cv_prog_cc_ubsan=yes
else
ac_cv_prog_cc_ubsan=no
fi
rm -rf conftest*
])
])
AC_DEFUN([COMPILER_FLAGS], [
if (test "${CFLAGS}" = ""); then
CFLAGS="-Wall -O2 -fsigned-char -fno-exceptions"
CFLAGS+=" -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
fi
if (test "$USE_MAINTAINER_MODE" = "yes"); then
CFLAGS+=" -Werror -Wextra"
CFLAGS+=" -Wno-unused-parameter"
CFLAGS+=" -Wno-missing-field-initializers"
CFLAGS+=" -Wdeclaration-after-statement"
CFLAGS+=" -Wmissing-declarations"
CFLAGS+=" -Wredundant-decls"
CFLAGS+=" -Wformat -Wformat-security"
if ( $CC -v 2>/dev/null | grep "gcc version" ); then
CFLAGS+=" -Wcast-align"
fi
fi
if (test "$CC" = "clang"); then
CFLAGS+=" -Wno-unknown-warning-option"
CFLAGS+=" -Wno-unknown-pragmas"
fi
])