From patchwork Sat Apr 21 18:30:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 26896 Received: (qmail 85598 invoked by alias); 21 Apr 2018 18:31:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 84349 invoked by uid 89); 21 Apr 2018 18:31:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=wnonarrowing, dlsym, Wnonarrowing, Wno-narrowing X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.51.253) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 21 Apr 2018 18:31:04 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 91D28343CE9 for ; Sat, 21 Apr 2018 13:31:03 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 9xHrf1GDHbXuJ9xHrfOYpn; Sat, 21 Apr 2018 13:31:03 -0500 X-Authority-Reason: nr=8 Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:50954 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1f9xHr-002rFx-Ca; Sat, 21 Apr 2018 13:31:03 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 9/9] Add -Wimplicit-fallthrough Date: Sat, 21 Apr 2018 12:30:56 -0600 Message-Id: <20180421183056.29292-10-tom@tromey.com> In-Reply-To: <20180421183056.29292-1-tom@tromey.com> References: <20180421183056.29292-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1f9xHr-002rFx-Ca X-Source-Sender: 97-122-176-117.hlrn.qwest.net (bapiya.Home) [97.122.176.117]:50954 X-Source-Auth: tom+tromey.com X-Email-Count: 11 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes This adds -Wimplicit-fallthrough to the set of default warnings. ../ChangeLog 2018-04-21 Tom Tromey * configure: Rebuild. * warning.m4 (AM_GDB_WARNINGS): Add -Wimplicit-fallthrough. ChangeLog 2018-04-21 Tom Tromey * configure: Rebuild. --- gdb/ChangeLog | 5 +++++ gdb/configure | 26 +++++++++++++------------- gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/configure | 31 +++++++++++++++++++------------ gdb/warning.m4 | 2 +- 5 files changed, 42 insertions(+), 26 deletions(-) diff --git a/gdb/configure b/gdb/configure index b313152018..648f08f2e8 100755 --- a/gdb/configure +++ b/gdb/configure @@ -4463,9 +4463,9 @@ else fi if test "$plugins" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -$as_echo_n "checking for library containing dlopen... " >&6; } -if test "${ac_cv_search_dlopen+set}" = set; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5 +$as_echo_n "checking for library containing dlsym... " >&6; } +if test "${ac_cv_search_dlsym+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS @@ -4478,11 +4478,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dlopen (); +char dlsym (); int main () { -return dlopen (); +return dlsym (); ; return 0; } @@ -4495,25 +4495,25 @@ for ac_lib in '' dl; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_dlopen=$ac_res + ac_cv_search_dlsym=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext - if test "${ac_cv_search_dlopen+set}" = set; then : + if test "${ac_cv_search_dlsym+set}" = set; then : break fi done -if test "${ac_cv_search_dlopen+set}" = set; then : +if test "${ac_cv_search_dlsym+set}" = set; then : else - ac_cv_search_dlopen=no + ac_cv_search_dlsym=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -$as_echo "$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5 +$as_echo "$ac_cv_search_dlsym" >&6; } +ac_res=$ac_cv_search_dlsym if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -15364,7 +15364,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-switch -Wno-char-subscripts \ -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \ -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized \ --Wno-mismatched-tags \ +-Wno-mismatched-tags -Wimplicit-fallthrough \ -Wno-error=deprecated-register" case "${host}" in diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index ab09261946..3e3d6c50b3 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -4658,7 +4658,7 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # We require a C++11 compiler. Check if one is available, and if # necessary, set CXX_DIALECT to some -std=xxx switch. - ax_cxx_compile_cxx11_required=true + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4974,7 +4974,8 @@ $as_echo "$ax_cv_cxx_compile_cxx11" >&6; } fi if test x$ac_success = xno; then - for switch in -std=gnu++11 -std=gnu++0x; do + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } @@ -5292,16 +5293,17 @@ $as_echo "$ac_res" >&6; } fi if test x$ac_success = xno; then - for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do - cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if { as_var=$cachevar; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5596,14 +5598,18 @@ else eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXX="$ac_save_CXX" + CXX="$ac_save_CXX" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX_DIALECT="$switch" - ac_success=yes + if eval test x\$$cachevar = xyes; then + CXX_DIALECT="$switch" + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then break fi done @@ -7165,7 +7171,8 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-switch -Wno-char-subscripts \ -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \ -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized \ --Wno-mismatched-tags" +-Wno-mismatched-tags -Wimplicit-fallthrough \ +-Wno-error=deprecated-register" case "${host}" in *-*-mingw32*) diff --git a/gdb/warning.m4 b/gdb/warning.m4 index 3cfae65e78..791465110f 100644 --- a/gdb/warning.m4 +++ b/gdb/warning.m4 @@ -41,7 +41,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-switch -Wno-char-subscripts \ -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \ -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized \ --Wno-mismatched-tags \ +-Wno-mismatched-tags -Wimplicit-fallthrough \ -Wno-error=deprecated-register" case "${host}" in