configure: add -Wno-nullability-completeness
for xform output
Mac OS X header files for 10.12 include `_Nullable` and `_Nonnull` annotations. When those appear in xform output, they're no longer counted as being in system headers, and so nullability completeness is enabled. Disable is explicitly when the flag is supported.
This commit is contained in:
parent
5833390396
commit
0d4e2a3275
31
racket/src/configure
vendored
31
racket/src/configure
vendored
|
@ -3218,6 +3218,7 @@ use_flag_pthread=yes
|
|||
use_flag_posix_pthread=no
|
||||
skip_iconv_check=no
|
||||
check_page_size=yes
|
||||
try_no_nullability_completeness=no
|
||||
|
||||
MAKE_LOCAL_RACKET=no-local-racket
|
||||
|
||||
|
@ -4828,6 +4829,12 @@ fi
|
|||
# and that breaks static allocation of fd_sets
|
||||
try_poll_syscall=yes
|
||||
|
||||
# -pthread is not needed and triggers a warning
|
||||
use_flag_pthread=no
|
||||
|
||||
# Use -Wno-nullability-completeness if supported
|
||||
try_no_nullability_completeness=yes
|
||||
|
||||
# ".a" is typically not useful, since we always build a ".dylib":
|
||||
if test "${enable_libs}" == "" ; then
|
||||
INSTALL_LIBS_ENABLE=no-install
|
||||
|
@ -5871,6 +5878,30 @@ if test "${LFS_CFLAGS}" != "" && test "${LFS_CFLAGS}" != "undefined"; then
|
|||
MZOPTIONS="${MZOPTIONS} ${LFS_CFLAGS}"
|
||||
fi
|
||||
|
||||
if test "${try_no_nullability_completeness}" = "yes" ; then
|
||||
msg="for -Wno-nullability-completeness"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $msg" >&5
|
||||
$as_echo_n "checking $msg... " >&6; }
|
||||
OLD_CFLAGS="${CFLAGS}"
|
||||
CFLAGS="${CFLAGS} -Wno-nullability-completeness"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
int main() { return 0; }
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
nonullcomp=yes
|
||||
else
|
||||
nonullcomp=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
if test "$nonullcomp" = "yes" ; then
|
||||
GC2OPTIONS="$GC2OPTIONS -Wno-nullability-completeness"
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $nonullcomp" >&5
|
||||
$as_echo "$nonullcomp" >&6; }
|
||||
CFLAGS="${OLD_CFLAGS}"
|
||||
fi
|
||||
|
||||
###### Get data sizes, stack direction, and endianness #######
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
|
|
|
@ -474,6 +474,7 @@ use_flag_pthread=yes
|
|||
use_flag_posix_pthread=no
|
||||
skip_iconv_check=no
|
||||
check_page_size=yes
|
||||
try_no_nullability_completeness=no
|
||||
|
||||
MAKE_LOCAL_RACKET=no-local-racket
|
||||
|
||||
|
@ -894,6 +895,12 @@ case "$host_os" in
|
|||
# and that breaks static allocation of fd_sets
|
||||
try_poll_syscall=yes
|
||||
|
||||
# -pthread is not needed and triggers a warning
|
||||
use_flag_pthread=no
|
||||
|
||||
# Use -Wno-nullability-completeness if supported
|
||||
try_no_nullability_completeness=yes
|
||||
|
||||
# ".a" is typically not useful, since we always build a ".dylib":
|
||||
if test "${enable_libs}" == "" ; then
|
||||
INSTALL_LIBS_ENABLE=no-install
|
||||
|
@ -1323,6 +1330,19 @@ if test "${LFS_CFLAGS}" != "" && test "${LFS_CFLAGS}" != "undefined"; then
|
|||
MZOPTIONS="${MZOPTIONS} ${LFS_CFLAGS}"
|
||||
fi
|
||||
|
||||
if test "${try_no_nullability_completeness}" = "yes" ; then
|
||||
[ msg="for -Wno-nullability-completeness" ]
|
||||
AC_MSG_CHECKING($msg)
|
||||
OLD_CFLAGS="${CFLAGS}"
|
||||
CFLAGS="${CFLAGS} -Wno-nullability-completeness"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])], nonullcomp=yes, nonullcomp=no)
|
||||
if test "$nonullcomp" = "yes" ; then
|
||||
GC2OPTIONS="$GC2OPTIONS -Wno-nullability-completeness"
|
||||
fi
|
||||
AC_MSG_RESULT($nonullcomp)
|
||||
CFLAGS="${OLD_CFLAGS}"
|
||||
fi
|
||||
|
||||
###### Get data sizes, stack direction, and endianness #######
|
||||
|
||||
AC_CHECK_SIZEOF(char)
|
||||
|
|
Loading…
Reference in New Issue
Block a user