From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96907 invoked by alias); 27 May 2015 16:10:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 96894 invoked by uid 89); 27 May 2015 16:10:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 27 May 2015 16:10:09 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 32DED8EFDB; Wed, 27 May 2015 16:10:08 +0000 (UTC) Received: from [10.10.116.26] ([10.10.116.26]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4RGA7M0029735; Wed, 27 May 2015 12:10:07 -0400 Message-ID: <5565EC5A.10608@redhat.com> Date: Wed, 27 May 2015 16:20:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Richard Biener , Andreas Schwab CC: Alexandre Oliva , gcc-patches List Subject: Re: PATCH to run autoconf tests with C++ compiler References: <555EA4B1.8090706@redhat.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------060604000908030804060503" X-SW-Source: 2015-05/txt/msg02489.txt.bz2 This is a multi-part message in MIME format. --------------060604000908030804060503 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 657 On 05/27/2015 08:54 AM, Richard Biener wrote: > On Wed, May 27, 2015 at 10:49 AM, Andreas Schwab wrote: >> This breaks all checks for supported compiler options: >> >> configure:6382: checking whether gcc supports -Wnarrowing >> configure:6399: gcc -c -Wnarrowing conftest.c >&5 >> cc1: error: unrecognized command line option "-Wnarrowing" >> configure:6399: $? = 1 >> >> configure:6485: checking whether gcc supports -Wnarrowing >> configure:6502: g++ -std=c++98 -c -g conftest.cpp >&5 >> configure:6502: $? = 0 >> configure:6511: result: yes > > And thus causes PR66304, bootstrap failure with host gcc 4.3 (at least). Fixed thus: --------------060604000908030804060503 Content-Type: text/x-patch; name="66304.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="66304.patch" Content-length: 18878 commit 0af5fc110196c2e9421f65c48ac09391bce031e3 Author: Jason Merrill Date: Wed May 27 09:49:06 2015 -0400 PR bootstrap/66304 config/ * warnings.m4 (ACX_PROG_CXX_WARNING_OPTS) (ACX_PROG_CXX_WARNINGS_ARE_ERRORS) (ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC): New. (ACX_PROG_CC_WARNING_OPTS, ACX_PROG_CC_WARNING_ALMOST_PEDANTIC) (ACX_PROG_CC_WARNINGS_ARE_ERRORS): Push into C language context. gcc/ * configure.ac: Use ACX_PROG_CXX_WARNING_OPTS, ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC, and ACX_PROG_CXX_WARNINGS_ARE_ERRORS. * configure: Regenerate. diff --git a/config/warnings.m4 b/config/warnings.m4 index b64b594..b5a149a 100644 --- a/config/warnings.m4 +++ b/config/warnings.m4 @@ -23,6 +23,7 @@ # compiler accepts. AC_DEFUN([ACX_PROG_CC_WARNING_OPTS], [AC_REQUIRE([AC_PROG_CC])dnl +AC_LANG_PUSH(C) m4_pushdef([acx_Var], [m4_default([$2], [WARN_CFLAGS])])dnl AC_SUBST(acx_Var)dnl m4_expand_once([acx_Var= @@ -48,6 +49,7 @@ for real_option in $1; do done CFLAGS="$save_CFLAGS" m4_popdef([acx_Var])dnl +AC_LANG_POP(C) ])# ACX_PROG_CC_WARNING_OPTS # ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC]) @@ -55,6 +57,7 @@ m4_popdef([acx_Var])dnl # and accepts all of those options simultaneously, otherwise to nothing. AC_DEFUN([ACX_PROG_CC_WARNING_ALMOST_PEDANTIC], [AC_REQUIRE([AC_PROG_CC])dnl +AC_LANG_PUSH(C) m4_pushdef([acx_Var], [m4_default([$2], [WARN_PEDANTIC])])dnl AC_SUBST(acx_Var)dnl m4_expand_once([acx_Var= @@ -77,6 +80,7 @@ AS_IF([test AS_VAR_GET(acx_Pedantic) = yes], AS_VAR_POPDEF([acx_Pedantic])dnl m4_popdef([acx_Woptions])dnl m4_popdef([acx_Var])dnl +AC_LANG_POP(C) ])# ACX_PROG_CC_WARNING_ALMOST_PEDANTIC # ACX_PROG_CC_WARNINGS_ARE_ERRORS([x.y.z], [VARIABLE = WERROR]) @@ -88,6 +92,7 @@ m4_popdef([acx_Var])dnl # appeared on the configure command line. AC_DEFUN([ACX_PROG_CC_WARNINGS_ARE_ERRORS], [AC_REQUIRE([AC_PROG_CC])dnl +AC_LANG_PUSH(C) m4_pushdef([acx_Var], [m4_default([$2], [WERROR])])dnl AC_SUBST(acx_Var)dnl m4_expand_once([acx_Var= @@ -114,4 +119,109 @@ AS_IF([test $enable_werror_always = yes], [acx_Var="$acx_Var${acx_Var:+ }-Werror"]) AS_VAR_POPDEF([acx_GCCvers])]) m4_popdef([acx_Var])dnl +AC_LANG_POP(C) ])# ACX_PROG_CC_WARNINGS_ARE_ERRORS + +# ACX_PROG_CXX_WARNING_OPTS(WARNINGS, [VARIABLE = WARN_CFLAGS) +# Sets @VARIABLE@ to the subset of the given options which the +# compiler accepts. +AC_DEFUN([ACX_PROG_CXX_WARNING_OPTS], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_LANG_PUSH(C++) +m4_pushdef([acx_Var], [m4_default([$2], [WARN_CXXFLAGS])])dnl +AC_SUBST(acx_Var)dnl +m4_expand_once([acx_Var= +],m4_quote(acx_Var=))dnl +save_CXXFLAGS="$CXXFLAGS" +for real_option in $1; do + # Do the check with the no- prefix removed since gcc silently + # accepts any -Wno-* option on purpose + case $real_option in + -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;; + *) option=$real_option ;; + esac + AS_VAR_PUSHDEF([acx_Woption], [acx_cv_prog_cc_warning_$option]) + AC_CACHE_CHECK([whether $CXX supports $option], acx_Woption, + [CXXFLAGS="$option" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_VAR_SET(acx_Woption, yes)], + [AS_VAR_SET(acx_Woption, no)]) + ]) + AS_IF([test AS_VAR_GET(acx_Woption) = yes], + [acx_Var="$acx_Var${acx_Var:+ }$real_option"]) + AS_VAR_POPDEF([acx_Woption])dnl +done +CXXFLAGS="$save_CXXFLAGS" +m4_popdef([acx_Var])dnl +AC_LANG_POP(C++) +])# ACX_PROG_CXX_WARNING_OPTS + +# ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC(WARNINGS, [VARIABLE = WARN_PEDANTIC]) +# Append to VARIABLE "-pedantic" + the argument, if the compiler is G++ +# and accepts all of those options simultaneously, otherwise to nothing. +AC_DEFUN([ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_LANG_PUSH(C++) +m4_pushdef([acx_Var], [m4_default([$2], [WARN_PEDANTIC])])dnl +AC_SUBST(acx_Var)dnl +m4_expand_once([acx_Var= +],m4_quote(acx_Var=))dnl +# Do the check with the no- prefix removed from the warning options +# since gcc silently accepts any -Wno-* option on purpose +m4_pushdef([acx_Woptions], [m4_bpatsubst([$1], [-Wno-], [-W])])dnl +AS_VAR_PUSHDEF([acx_Pedantic], [acx_cv_prog_cc_pedantic_]acx_Woptions)dnl +AS_IF([test "$GXX" = yes], +[AC_CACHE_CHECK([whether $CXX supports -pedantic ]acx_Woptions, acx_Pedantic, +[save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="-pedantic acx_Woptions" +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_VAR_SET(acx_Pedantic, yes)], + [AS_VAR_SET(acx_Pedantic, no)]) +CXXFLAGS="$save_CXXFLAGS"]) +AS_IF([test AS_VAR_GET(acx_Pedantic) = yes], + [acx_Var="$acx_Var${acx_Var:+ }-pedantic $1"]) +]) +AS_VAR_POPDEF([acx_Pedantic])dnl +m4_popdef([acx_Woptions])dnl +m4_popdef([acx_Var])dnl +AC_LANG_POP(C++) +])# ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC + +# ACX_PROG_CXX_WARNINGS_ARE_ERRORS([x.y.z], [VARIABLE = WERROR]) +# sets @VARIABLE@ to "-Werror" if the compiler is G++ >=x.y.z, or if +# --enable-werror-always was given on the command line, otherwise +# to nothing. +# If the argument is the word "manual" instead of a version number, +# then @VARIABLE@ will be set to -Werror only if --enable-werror-always +# appeared on the configure command line. +AC_DEFUN([ACX_PROG_CXX_WARNINGS_ARE_ERRORS], +[AC_REQUIRE([AC_PROG_CXX])dnl +AC_LANG_PUSH(C++) +m4_pushdef([acx_Var], [m4_default([$2], [WERROR])])dnl +AC_SUBST(acx_Var)dnl +m4_expand_once([acx_Var= +],m4_quote(acx_Var=))dnl +AC_ARG_ENABLE(werror-always, + AS_HELP_STRING([--enable-werror-always], + [enable -Werror despite compiler version]), +[], [enable_werror_always=no]) +AS_IF([test $enable_werror_always = yes], + [acx_Var="$acx_Var${acx_Var:+ }-Werror"]) + m4_if($1, [manual],, + [AS_VAR_PUSHDEF([acx_GXXvers], [acx_cv_prog_cxx_gxx_$1_or_newer])dnl + AC_CACHE_CHECK([whether $CXX is G++ >=$1], acx_GXXvers, + [set fnord `echo $1 | tr '.' ' '` + shift + AC_PREPROC_IFELSE( +[#if __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ \ + < [$]1 * 10000 + [$]2 * 100 + [$]3 +#error insufficient +#endif], + [AS_VAR_SET(acx_GXXvers, yes)], + [AS_VAR_SET(acx_GXXvers, no)])]) + AS_IF([test AS_VAR_GET(acx_GXXvers) = yes], + [acx_Var="$acx_Var${acx_Var:+ }-Werror"]) + AS_VAR_POPDEF([acx_GXXvers])]) +m4_popdef([acx_Var])dnl +AC_LANG_POP(C++) +])# ACX_PROG_CXX_WARNINGS_ARE_ERRORS diff --git a/gcc/configure b/gcc/configure index a62f232..f08c17f 100755 --- a/gcc/configure +++ b/gcc/configure @@ -6471,8 +6471,14 @@ if test $enable_build_format_warnings = no; then : else wf_opt= fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + loose_warn= -save_CFLAGS="$CFLAGS" +save_CXXFLAGS="$CXXFLAGS" for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual $wf_opt; do # Do the check with the no- prefix removed since gcc silently # accepts any -Wno-* option on purpose @@ -6482,12 +6488,12 @@ for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual $wf_opt; esac as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 -$as_echo_n "checking whether $CC supports $option... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports $option" >&5 +$as_echo_n "checking whether $CXX supports $option... " >&6; } if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - CFLAGS="$option" + CXXFLAGS="$option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6514,7 +6520,20 @@ $as_echo "$ac_res" >&6; } loose_warn="$loose_warn${loose_warn:+ }$real_option" fi done -CFLAGS="$save_CFLAGS" +CXXFLAGS="$save_CXXFLAGS" +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu c_loose_warn= save_CFLAGS="$CFLAGS" @@ -6544,7 +6563,7 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$as_acx_Woption=yes" else eval "$as_acx_Woption=no" @@ -6560,9 +6579,21 @@ $as_echo "$ac_res" >&6; } fi done CFLAGS="$save_CFLAGS" +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu strict_warn= -save_CFLAGS="$CFLAGS" +save_CXXFLAGS="$CXXFLAGS" for real_option in -Wmissing-format-attribute; do # Do the check with the no- prefix removed since gcc silently # accepts any -Wno-* option on purpose @@ -6572,12 +6603,12 @@ for real_option in -Wmissing-format-attribute; do esac as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 -$as_echo_n "checking whether $CC supports $option... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports $option" >&5 +$as_echo_n "checking whether $CXX supports $option... " >&6; } if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - CFLAGS="$option" + CXXFLAGS="$option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6604,9 +6635,21 @@ $as_echo "$ac_res" >&6; } strict_warn="$strict_warn${strict_warn:+ }$real_option" fi done -CFLAGS="$save_CFLAGS" +CXXFLAGS="$save_CXXFLAGS" +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -save_CFLAGS="$CFLAGS" + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +save_CXXFLAGS="$CXXFLAGS" for real_option in -Woverloaded-virtual; do # Do the check with the no- prefix removed since gcc silently # accepts any -Wno-* option on purpose @@ -6616,12 +6659,12 @@ for real_option in -Woverloaded-virtual; do esac as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 -$as_echo_n "checking whether $CC supports $option... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports $option" >&5 +$as_echo_n "checking whether $CXX supports $option... " >&6; } if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else - CFLAGS="$option" + CXXFLAGS="$option" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6648,7 +6691,19 @@ $as_echo "$ac_res" >&6; } strict_warn="$strict_warn${strict_warn:+ }$real_option" fi done -CFLAGS="$save_CFLAGS" +CXXFLAGS="$save_CXXFLAGS" +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu c_strict_warn= save_CFLAGS="$CFLAGS" @@ -6678,7 +6733,7 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$as_acx_Woption=yes" else eval "$as_acx_Woption=no" @@ -6694,17 +6749,29 @@ $as_echo "$ac_res" >&6; } fi done CFLAGS="$save_CFLAGS" +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Do the check with the no- prefix removed from the warning options # since gcc silently accepts any -Wno-* option on purpose -if test "$GCC" = yes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -pedantic -Wlong-long -Wvariadic-macros -Woverlength-strings" >&5 -$as_echo_n "checking whether $CC supports -pedantic -Wlong-long -Wvariadic-macros -Woverlength-strings... " >&6; } +if test "$GXX" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports -pedantic -Wlong-long -Wvariadic-macros -Woverlength-strings" >&5 +$as_echo_n "checking whether $CXX supports -pedantic -Wlong-long -Wvariadic-macros -Woverlength-strings... " >&6; } if test "${acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings+set}" = set; then : $as_echo_n "(cached) " >&6 else - save_CFLAGS="$CFLAGS" -CFLAGS="-pedantic -Wlong-long -Wvariadic-macros -Woverlength-strings" + save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS="-pedantic -Wlong-long -Wvariadic-macros -Woverlength-strings" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6722,7 +6789,7 @@ else acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CFLAGS="$save_CFLAGS" +CXXFLAGS="$save_CXXFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings" >&5 $as_echo "$acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_strings" >&6; } @@ -6731,6 +6798,18 @@ if test $acx_cv_prog_cc_pedantic__Wlong_long__Wvariadic_macros__Woverlength_stri fi fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # Check whether --enable-werror-always was given. if test "${enable_werror_always+set}" = set; then : @@ -6743,6 +6822,12 @@ if test $enable_werror_always = yes; then : strict_warn="$strict_warn${strict_warn:+ }-Werror" fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + # The above macros do nothing if the compiler is not GCC. However, the @@ -6758,6 +6843,12 @@ fi # Disable exceptions and RTTI if building with g++ +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + noexception_flags= save_CFLAGS="$CFLAGS" for real_option in -fno-exceptions -fno-rtti -fasynchronous-unwind-tables; do @@ -6786,7 +6877,7 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO"; then : eval "$as_acx_Woption=yes" else eval "$as_acx_Woption=no" @@ -6802,6 +6893,12 @@ $as_echo "$ac_res" >&6; } fi done CFLAGS="$save_CFLAGS" +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + # Enable expensive internal checks @@ -13885,7 +13982,6 @@ fi - # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; @@ -18197,7 +18293,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18200 "configure" +#line 18296 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -18303,7 +18399,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 18306 "configure" +#line 18402 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 71b5f4f..c76d06d 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -368,21 +368,21 @@ AC_ARG_ENABLE(build-format-warnings, [],[enable_build_format_warnings=yes]) AS_IF([test $enable_build_format_warnings = no], [wf_opt=-Wno-format],[wf_opt=]) -ACX_PROG_CC_WARNING_OPTS( +ACX_PROG_CXX_WARNING_OPTS( m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual $wf_opt])), [loose_warn]) ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])), [c_loose_warn]) -ACX_PROG_CC_WARNING_OPTS( +ACX_PROG_CXX_WARNING_OPTS( m4_quote(m4_do([-Wmissing-format-attribute])), [strict_warn]) -ACX_PROG_CC_WARNING_OPTS( +ACX_PROG_CXX_WARNING_OPTS( m4_quote(m4_do([-Woverloaded-virtual])), [strict_warn]) ACX_PROG_CC_WARNING_OPTS( m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn]) -ACX_PROG_CC_WARNING_ALMOST_PEDANTIC( +ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC( m4_quote(m4_do([-Wno-long-long -Wno-variadic-macros ], [-Wno-overlength-strings])), [strict_warn]) -ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual], [strict_warn]) +ACX_PROG_CXX_WARNINGS_ARE_ERRORS([manual], [strict_warn]) # The above macros do nothing if the compiler is not GCC. However, the # Makefile has more goo to add other flags, so these variables are used --------------060604000908030804060503--