mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-14 12:05:03 +00:00
build: fix configure check for CC support of _Generic() and __auto_type
autotools' AC_LANG_PROGRAM() generates a main() function which triggers
a compiler warning (for which we fail with -WError).
conftest.c:92:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
main ()
^~~~
cc1: all warnings being treated as errors
Fixes: 557d83bf2d
This commit is contained in:
parent
8ad310f8e3
commit
a43bf33888
|
@ -1173,16 +1173,16 @@ fi
|
|||
AC_SUBST(SANITIZERS, [$sanitizers])
|
||||
|
||||
AC_MSG_CHECKING([CC support C11 _Generic()])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(void); int foo() { int a = 0; int b = _Generic (a, int: 4); return b + a; }]],
|
||||
[[foo();]])],
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int foo(void); int foo() { int a = 0; int b = _Generic (a, int: 4); return b + a; }]],
|
||||
[[foo();]])],
|
||||
[cc_support_generic=1],
|
||||
[cc_support_generic=0])
|
||||
AC_MSG_RESULT($cc_support_generic)
|
||||
AC_DEFINE_UNQUOTED(_NM_CC_SUPPORT_GENERIC, $cc_support_generic, [Define whether the compiler supports C11 _Generic()])
|
||||
|
||||
AC_MSG_CHECKING([CC support gcc __auto_type])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int foo(void); int foo() { int a = 0; __auto_type b = a; return b + a; }]],
|
||||
[[foo();]])],
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int foo(void); int foo() { int a = 0; __auto_type b = a; return b + a; }]],
|
||||
[[foo();]])],
|
||||
[cc_support_auto_type=1],
|
||||
[cc_support_auto_type=0])
|
||||
AC_MSG_RESULT($cc_support_auto_type)
|
||||
|
|
Loading…
Reference in a new issue