From 5db388f67a97d5fd1d18d1be53dd4e3e196dfe2f Mon Sep 17 00:00:00 2001 From: NicJA Date: Tue, 9 Aug 2016 19:30:14 +0000 Subject: [PATCH] check for -Wreturn-type git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@52846 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- config/compiler.cfg.in | 1 + config/features | 29 +++++++++++++++++++++++++++++ config/features.in | 10 ++++++++++ 3 files changed, 40 insertions(+) diff --git a/config/compiler.cfg.in b/config/compiler.cfg.in index f86baff792..1ece36e740 100644 --- a/config/compiler.cfg.in +++ b/config/compiler.cfg.in @@ -66,3 +66,4 @@ NOWARN_CONVERSION_NULL := @aros_cflags_conversion_null@ NOWARN_NARROWING := @aros_cflags_narrowing@ NOWARN_VOLATILE_REGISTER_VAR := @aros_cflags_volatile_register_var@ NOWARN_SIZEOF_POINTER_MEMACCESS := @aros_cflags_sizeof_pointer_memaccess@ +NOWARN_RETURN_TYPE := @aros_cflags_return_type@ diff --git a/config/features b/config/features index 82ab8658bd..dc59311b0e 100755 --- a/config/features +++ b/config/features @@ -584,6 +584,7 @@ PACKAGE_URL= ac_unique_file="../mmakefile" ac_subst_vars='LTLIBOBJS LIBOBJS +aros_cflags_return_type aros_cflags_sizeof_pointer_memaccess aros_cflags_volatile_register_var aros_cflags_narrowing @@ -2837,6 +2838,7 @@ fi # -Wnarrowing # -Wvolatile-register-var # -Wsizeof-pointer-memaccess +# -Wreturn-type { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -Wunused-command-line-argument" >&5 $as_echo_n "checking whether ${CC} accepts -Wunused-command-line-argument... " >&6; } @@ -4244,6 +4246,33 @@ if test "x-$aros_sizeof_pointer_memaccess" = "x-yes" ; then aros_cflags_sizeof_pointer_memaccess=-Wno-sizeof-pointer-memaccess fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -Wreturn-type" >&5 +$as_echo_n "checking whether ${CC} accepts -Wreturn-type... " >&6; } +CFLAGS=-Wreturn-type +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_return_type="yes" +else + aros_return_type="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_return_type" >&5 +$as_echo "$aros_return_type" >&6; } +if test "x-$aros_return_type" = "x-yes" ; then + aros_cflags_return_type=-Wno-return-type +fi + + diff --git a/config/features.in b/config/features.in index 85c6e7246f..ad9018a702 100644 --- a/config/features.in +++ b/config/features.in @@ -140,6 +140,7 @@ fi # -Wnarrowing # -Wvolatile-register-var # -Wsizeof-pointer-memaccess +# -Wreturn-type AC_MSG_CHECKING([whether ${CC} accepts -Wunused-command-line-argument]) CFLAGS=-Wunused-command-line-argument @@ -575,6 +576,14 @@ if test "x-$aros_sizeof_pointer_memaccess" = "x-yes" ; then aros_cflags_sizeof_pointer_memaccess=-Wno-sizeof-pointer-memaccess fi +AC_MSG_CHECKING([whether ${CC} accepts -Wreturn-type]) +CFLAGS=-Wreturn-type +AC_TRY_COMPILE(,, aros_return_type="yes", aros_return_type="no") +AC_MSG_RESULT($aros_return_type) +if test "x-$aros_return_type" = "x-yes" ; then + aros_cflags_return_type=-Wno-return-type +fi + AC_SUBST(aros_cflags_lto) AC_SUBST(aros_cflags_loop_block) AC_SUBST(aros_cflags_loop_interchange) @@ -637,6 +646,7 @@ AC_SUBST(aros_cflags_conversion_null) AC_SUBST(aros_cflags_narrowing) AC_SUBST(aros_cflags_volatile_register_var) AC_SUBST(aros_cflags_sizeof_pointer_memaccess) +AC_SUBST(aros_cflags_return_type) AC_CONFIG_FILES( ${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in -- 2.11.4.GIT