From 4f97e74239786f879056116c4bf993b97491963c Mon Sep 17 00:00:00 2001 From: wawa Date: Tue, 26 Jun 2018 22:44:15 +0000 Subject: [PATCH] forwarding nowarn flags neccessary for interim contrib compilation with gcc-8.1.0: implicit-fallthrough, missing-prototypes, class-memaccess and int-in-bool-context. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@55358 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- config/compiler.cfg.in | 17 ++++ config/features | 223 +++++++++++++++++++++++++++++++++++++++++++++++++ config/features.in | 86 ++++++++++++++++++- 3 files changed, 325 insertions(+), 1 deletion(-) diff --git a/config/compiler.cfg.in b/config/compiler.cfg.in index f2637bbec9..19ee29f829 100644 --- a/config/compiler.cfg.in +++ b/config/compiler.cfg.in @@ -39,6 +39,10 @@ CFLAGS_IPA_CP := @aros_cflags_ipacp@ CFLAGS_NO_IPA_CP := @aros_cflags_noipacp@ # +CFLAGS_OMIT_FP := @aros_cflags_omitfp@ +CFLAGS_NO_OMIT_FP := @aros_cflags_noomitfp@ + +# # -iquote support # CFLAGS_IQUOTE := @aros_cflags_iquote@ @@ -54,6 +58,9 @@ CFLAGS_NO_RED_ZONE := @aros_cflags_no_red_zone@ # WARN_ERROR := @aros_warnflags_error@ +WARN_ALL := @aros_warnflags_all@ + +WARN_RESTRICT := @aros_warnflags_restrict@ WARN_UNUSED_COMMAND_LINE_ARGUMENT := @aros_warnflags_unused_command_line_argument@ WARN_UNKNOWN_WARNING_OPTION := @aros_warnflags_unknown_warning_option@ @@ -122,6 +129,10 @@ WARN_FORMAT_TRUNCATION := @aros_warnflags_format_truncation@ WARN_STRINGOP_TRUNCATION := @aros_warnflags_stringop_truncation@ WARN_SHIFT_NEGATIVE_VALUE := @aros_warnflags_shift_negative_value@ WARN_MISSING_FIELD_INITIALIZERS := @aros_warnflags_missing_field_initializers@ +WARN_IMPLICIT_FALLTHROUGH := @aros_warnflags_implicit_fallthrough@ +WARN_MISSING_PROTOTYPES := @aros_warnflags_missing_prototypes@ +WARN_CLASS_MEMACCESS := @aros_warnflags_class_memaccess@ +WARN_INT_IN_BOOL_CONTEXT := @aros_warnflags_int_in_bool_context@ # # "Disable" compiler warning flags @@ -129,6 +140,8 @@ WARN_MISSING_FIELD_INITIALIZERS := @aros_warnflags_missing_field_initial NOWARN_ERROR := @aros_nowarnflags_error@ +NOWARN_RESTRICT := @aros_nowarnflags_restrict@ + NOWARN_UNUSED_COMMAND_LINE_ARGUMENT := @aros_nowarnflags_unused_command_line_argument@ NOWARN_UNKNOWN_WARNING_OPTION := @aros_nowarnflags_unknown_warning_option@ @@ -196,3 +209,7 @@ NOWARN_FORMAT_TRUNCATION := @aros_nowarnflags_format_truncation@ NOWARN_STRINGOP_TRUNCATION := @aros_nowarnflags_stringop_truncation@ NOWARN_SHIFT_NEGATIVE_VALUE := @aros_nowarnflags_shift_negative_value@ NOWARN_MISSING_FIELD_INITIALIZERS := @aros_nowarnflags_missing_field_initializers@ +NOWARN_IMPLICIT_FALLTHROUGH := @aros_nowarnflags_implicit_fallthrough@ +NOWARN_MISSING_PROTOTYPES := @aros_nowarnflags_missing_prototypes@ +NOWARN_CLASS_MEMACCESS := @aros_nowarnflags_class_memaccess@ +NOWARN_INT_IN_BOOL_CONTEXT := @aros_nowarnflags_int_in_bool_context@ diff --git a/config/features b/config/features index 385ffa84d5..691f2fc84b 100755 --- a/config/features +++ b/config/features @@ -584,6 +584,14 @@ PACKAGE_URL= ac_unique_file="../mmakefile" ac_subst_vars='LTLIBOBJS LIBOBJS +aros_nowarnflags_int_in_bool_context +aros_warnflags_int_in_bool_context +aros_nowarnflags_class_memaccess +aros_warnflags_class_memaccess +aros_nowarnflags_missing_prototypes +aros_warnflags_missing_prototypes +aros_nowarnflags_implicit_fallthrough +aros_warnflags_implicit_fallthrough aros_nowarnflags_missing_field_initializers aros_warnflags_missing_field_initializers aros_nowarnflags_shift_negative_value @@ -716,11 +724,16 @@ aros_nowarnflags_unknown_warning_option aros_warnflags_unknown_warning_option aros_nowarnflags_unused_command_line_argument aros_warnflags_unused_command_line_argument +aros_nowarnflags_restrict +aros_warnflags_restrict +aros_warnflags_all aros_nowarnflags_error aros_warnflags_error aros_cflags_no_red_zone aros_cflags_iquote_end aros_cflags_iquote +aros_cflags_noomitfp +aros_cflags_omitfp aros_cflags_noipacp aros_cflags_ipacp aros_cflags_noinlinesmallfunctions @@ -2749,6 +2762,7 @@ $as_echo "$aros_targetcfg_dir" >&6; } # -finline-small-functions # -fipa-cp # -funroll-loops +# -fomit-frame-pointer { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fexceptions" >&5 $as_echo_n "checking whether ${CC} accepts -fexceptions... " >&6; } @@ -2775,6 +2789,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext $as_echo "$aros_exceptions" >&6; } if test "x-$aros_exceptions" = "x-yes" ; then aros_cflags_exceptions=-fexceptions + aros_cflags_noexceptions=-fno-exceptions fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fpermissive" >&5 @@ -3119,6 +3134,33 @@ if test "x-$aros_ipa_cp" = "x-yes" ; then aros_cflags_noipacp=-fno-ipa-cp fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -fomit-frame-pointer" >&5 +$as_echo_n "checking whether ${CC} accepts -fomit-frame-pointer... " >&6; } +CFLAGS=-fomit-frame-pointer +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_omit_frame_pointer="yes" +else + aros_omit_frame_pointer="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_omit_frame_pointer" >&5 +$as_echo "$aros_omit_frame_pointer" >&6; } +if test "x-$aros_omit_frame_pointer" = "x-yes" ; then + aros_cflags_omitfp=-fomit-frame-pointer + aros_cflags_noomitfp=-fno-omit-frame-pointer +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -iquote" >&5 $as_echo_n "checking whether ${CC} accepts -iquote... " >&6; } CFLAGS="-iquote." @@ -3184,6 +3226,8 @@ fi # Check if the target compiler supports some options used for de-linting: # -Werror +# -Wall +# -Wrestrict # -Wunused-command-line-argument # -Wunknown-warning-option # -Wunused-but-set-variable @@ -3250,6 +3294,10 @@ fi # -Wstringop-truncation # -Wshift-negative-value # -Wmissing-field-initializers +# -Wimplicit-fallthrough +# -Wmissing-prototypes +# -Wclass-memaccess +# -Wint-in-bool-context { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -Werror" >&5 $as_echo_n "checking whether ${CC} accepts -Werror... " >&6; } @@ -3278,6 +3326,59 @@ if test "x-$aros_error" = "x-yes" ; then aros_nowarnflags_error=-Wno-error fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -Wall" >&5 +$as_echo_n "checking whether ${CC} accepts -Wall... " >&6; } +CFLAGS=-Wall +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_all="yes" +else + aros_all="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_all" >&5 +$as_echo "$aros_all" >&6; } +if test "x-$aros_all" = "x-yes" ; then + aros_warnflags_all=-Wall +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -Wrestrict" >&5 +$as_echo_n "checking whether ${CC} accepts -Wrestrict... " >&6; } +CFLAGS=-Wrestrict +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_restrict="yes" +else + aros_restrict="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_restrict" >&5 +$as_echo "$aros_restrict" >&6; } +if test "x-$aros_restrict" = "x-yes" ; then + aros_warnflags_restrict=-Wrestrict + aros_nowarnflags_restrict=-Wno-restrict +fi + { $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; } CFLAGS=-Wunused-command-line-argument @@ -5063,6 +5164,114 @@ if test "x-$aros_missing_field_initializers" = "x-yes" ; then aros_nowarnflags_missing_field_initializers=-Wno-missing-field-initializers fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -Wimplicit-fallthrough" >&5 +$as_echo_n "checking whether ${CC} accepts -Wimplicit-fallthrough... " >&6; } +CFLAGS=-Wimplicit-fallthrough +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_implicit_fallthrough="yes" +else + aros_implicit_fallthrough="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_implicit_fallthrough" >&5 +$as_echo "$aros_implicit_fallthrough" >&6; } +if test "x-$aros_implicit_fallthrough" = "x-yes" ; then + aros_warnflags_implicit_fallthrough=-Wimplicit-fallthrough + aros_nowarnflags_implicit_fallthrough=-Wno-implicit-fallthrough +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -Wmissing-prototypes" >&5 +$as_echo_n "checking whether ${CC} accepts -Wmissing-prototypes... " >&6; } +CFLAGS=-Wmissing-prototypes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_missing_prototypes="yes" +else + aros_missing_prototypes="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_missing_prototypes" >&5 +$as_echo "$aros_missing_prototypes" >&6; } +if test "x-$aros_missing_prototypes" = "x-yes" ; then + aros_warnflags_missing_prototypes=-Wmissing-prototypes + aros_nowarnflags_missing_prototypes=-Wno-missing-prototypes +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -Wclass-memaccess" >&5 +$as_echo_n "checking whether ${CC} accepts -Wclass-memaccess... " >&6; } +CFLAGS=-Wclass-memaccess +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_class_memaccess="yes" +else + aros_class_memaccess="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_class_memaccess" >&5 +$as_echo "$aros_class_memaccess" >&6; } +if test "x-$aros_class_memaccess" = "x-yes" ; then + aros_warnflags_class_memaccess=-Wclass-memaccess + aros_nowarnflags_class_memaccess=-Wno-class-memaccess +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} accepts -Wint-in-bool-context" >&5 +$as_echo_n "checking whether ${CC} accepts -Wint-in-bool-context... " >&6; } +CFLAGS=-Wint-in-bool-context +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + aros_int_in_bool_context="yes" +else + aros_int_in_bool_context="no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $aros_int_in_bool_context" >&5 +$as_echo "$aros_int_in_bool_context" >&6; } +if test "x-$aros_int_in_bool_context" = "x-yes" ; then + aros_warnflags_int_in_bool_context=-Wint-in-bool-context + aros_nowarnflags_int_in_bool_context=-Wno-int-in-bool-context +fi + # # export the feature flags... # @@ -5091,6 +5300,9 @@ fi + + + # # export the feature options... # @@ -5234,6 +5446,17 @@ fi + + + + + + + + + + + ac_config_files="$ac_config_files ${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in" diff --git a/config/features.in b/config/features.in index e2f3f02730..918eb3d11b 100644 --- a/config/features.in +++ b/config/features.in @@ -48,6 +48,7 @@ AC_MSG_RESULT($aros_targetcfg_dir) # -finline-small-functions # -fipa-cp # -funroll-loops +# -fomit-frame-pointer AC_MSG_CHECKING([whether ${CC} accepts -fexceptions]) CFLAGS=-fexceptions @@ -55,6 +56,7 @@ AC_TRY_COMPILE(,, aros_exceptions="yes", aros_exceptions="no") AC_MSG_RESULT($aros_exceptions) if test "x-$aros_exceptions" = "x-yes" ; then aros_cflags_exceptions=-fexceptions + aros_cflags_noexceptions=-fno-exceptions fi AC_MSG_CHECKING([whether ${CC} accepts -fpermissive]) @@ -165,6 +167,15 @@ if test "x-$aros_ipa_cp" = "x-yes" ; then aros_cflags_noipacp=-fno-ipa-cp fi +AC_MSG_CHECKING([whether ${CC} accepts -fomit-frame-pointer]) +CFLAGS=-fomit-frame-pointer +AC_TRY_COMPILE(,, aros_omit_frame_pointer="yes", aros_omit_frame_pointer="no") +AC_MSG_RESULT($aros_omit_frame_pointer) +if test "x-$aros_omit_frame_pointer" = "x-yes" ; then + aros_cflags_omitfp=-fomit-frame-pointer + aros_cflags_noomitfp=-fno-omit-frame-pointer +fi + AC_MSG_CHECKING([whether ${CC} accepts -iquote]) CFLAGS="-iquote." AC_TRY_COMPILE(,, has_iquote="yes", has_iquote="no") @@ -194,6 +205,8 @@ fi # Check if the target compiler supports some options used for de-linting: # -Werror +# -Wall +# -Wrestrict # -Wunused-command-line-argument # -Wunknown-warning-option # -Wunused-but-set-variable @@ -260,6 +273,10 @@ fi # -Wstringop-truncation # -Wshift-negative-value # -Wmissing-field-initializers +# -Wimplicit-fallthrough +# -Wmissing-prototypes +# -Wclass-memaccess +# -Wint-in-bool-context AC_MSG_CHECKING([whether ${CC} accepts -Werror]) CFLAGS=-Werror @@ -270,6 +287,23 @@ if test "x-$aros_error" = "x-yes" ; then aros_nowarnflags_error=-Wno-error fi +AC_MSG_CHECKING([whether ${CC} accepts -Wall]) +CFLAGS=-Wall +AC_TRY_COMPILE(,, aros_all="yes", aros_all="no") +AC_MSG_RESULT($aros_all) +if test "x-$aros_all" = "x-yes" ; then + aros_warnflags_all=-Wall +fi + +AC_MSG_CHECKING([whether ${CC} accepts -Wrestrict]) +CFLAGS=-Wrestrict +AC_TRY_COMPILE(,, aros_restrict="yes", aros_restrict="no") +AC_MSG_RESULT($aros_restrict) +if test "x-$aros_restrict" = "x-yes" ; then + aros_warnflags_restrict=-Wrestrict + aros_nowarnflags_restrict=-Wno-restrict +fi + AC_MSG_CHECKING([whether ${CC} accepts -Wunused-command-line-argument]) CFLAGS=-Wunused-command-line-argument AC_TRY_COMPILE(,, aros_unused_command_line_argument="yes", aros_unused_command_line_argument="no") @@ -867,6 +901,42 @@ if test "x-$aros_missing_field_initializers" = "x-yes" ; then aros_nowarnflags_missing_field_initializers=-Wno-missing-field-initializers fi +AC_MSG_CHECKING([whether ${CC} accepts -Wimplicit-fallthrough]) +CFLAGS=-Wimplicit-fallthrough +AC_TRY_COMPILE(,, aros_implicit_fallthrough="yes", aros_implicit_fallthrough="no") +AC_MSG_RESULT($aros_implicit_fallthrough) +if test "x-$aros_implicit_fallthrough" = "x-yes" ; then + aros_warnflags_implicit_fallthrough=-Wimplicit-fallthrough + aros_nowarnflags_implicit_fallthrough=-Wno-implicit-fallthrough +fi + +AC_MSG_CHECKING([whether ${CC} accepts -Wmissing-prototypes]) +CFLAGS=-Wmissing-prototypes +AC_TRY_COMPILE(,, aros_missing_prototypes="yes", aros_missing_prototypes="no") +AC_MSG_RESULT($aros_missing_prototypes) +if test "x-$aros_missing_prototypes" = "x-yes" ; then + aros_warnflags_missing_prototypes=-Wmissing-prototypes + aros_nowarnflags_missing_prototypes=-Wno-missing-prototypes +fi + +AC_MSG_CHECKING([whether ${CC} accepts -Wclass-memaccess]) +CFLAGS=-Wclass-memaccess +AC_TRY_COMPILE(,, aros_class_memaccess="yes", aros_class_memaccess="no") +AC_MSG_RESULT($aros_class_memaccess) +if test "x-$aros_class_memaccess" = "x-yes" ; then + aros_warnflags_class_memaccess=-Wclass-memaccess + aros_nowarnflags_class_memaccess=-Wno-class-memaccess +fi + +AC_MSG_CHECKING([whether ${CC} accepts -Wint-in-bool-context]) +CFLAGS=-Wint-in-bool-context +AC_TRY_COMPILE(,, aros_int_in_bool_context="yes", aros_int_in_bool_context="no") +AC_MSG_RESULT($aros_int_in_bool_context) +if test "x-$aros_int_in_bool_context" = "x-yes" ; then + aros_warnflags_int_in_bool_context=-Wint-in-bool-context + aros_nowarnflags_int_in_bool_context=-Wno-int-in-bool-context +fi + # # export the feature flags... # @@ -892,6 +962,9 @@ AC_SUBST(aros_cflags_noinlinesmallfunctions) AC_SUBST(aros_cflags_ipacp) AC_SUBST(aros_cflags_noipacp) +AC_SUBST(aros_cflags_omitfp) +AC_SUBST(aros_cflags_noomitfp) + AC_SUBST(aros_cflags_iquote) AC_SUBST(aros_cflags_iquote_end) @@ -905,6 +978,9 @@ AC_SUBST(aros_cflags_no_red_zone) # AC_SUBST(aros_warnflags_error) AC_SUBST(aros_nowarnflags_error) +AC_SUBST(aros_warnflags_all) +AC_SUBST(aros_warnflags_restrict) +AC_SUBST(aros_nowarnflags_restrict) AC_SUBST(aros_warnflags_unused_command_line_argument) AC_SUBST(aros_nowarnflags_unused_command_line_argument) AC_SUBST(aros_warnflags_unknown_warning_option) @@ -1037,7 +1113,15 @@ AC_SUBST(aros_warnflags_shift_negative_value) AC_SUBST(aros_nowarnflags_shift_negative_value) AC_SUBST(aros_warnflags_missing_field_initializers) AC_SUBST(aros_nowarnflags_missing_field_initializers) - +AC_SUBST(aros_warnflags_implicit_fallthrough) +AC_SUBST(aros_nowarnflags_implicit_fallthrough) +AC_SUBST(aros_warnflags_missing_prototypes) +AC_SUBST(aros_nowarnflags_missing_prototypes) +AC_SUBST(aros_warnflags_class_memaccess) +AC_SUBST(aros_nowarnflags_class_memaccess) +AC_SUBST(aros_warnflags_int_in_bool_context) +AC_SUBST(aros_nowarnflags_int_in_bool_context) + AC_CONFIG_FILES( ${aros_targetcfg_dir}/compiler.cfg:compiler.cfg.in ) -- 2.11.4.GIT