From patchwork Thu May 10 14:40:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27200 Received: (qmail 23786 invoked by alias); 10 May 2018 14:40:46 -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 23769 invoked by uid 89); 10 May 2018 14:40:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=fallthrough X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.200.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 May 2018 14:40:43 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 15B2D400E6EEB for ; Thu, 10 May 2018 09:40:42 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id GmkMfeKPJlAdrGmkMfBYpl; Thu, 10 May 2018 09:40:42 -0500 X-Authority-Reason: nr=8 Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:52260 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fGmkL-000OAc-QC; Thu, 10 May 2018 09:40:41 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA] Fix the clang build Date: Thu, 10 May 2018 08:40:39 -0600 Message-Id: <20180510144039.9474-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fGmkL-000OAc-QC X-Source-Sender: 97-122-176-117.hlrn.qwest.net (bapiya.Home) [97.122.176.117]:52260 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes Simon pointed out that gdb would not build with clang, due to the addition of -Wimplicit-fallthrough. This patch fixes the problem by using -Wimplicit-fallthrough=3 -- this does not work with clang, bypassing the issue. Tested by rebuilding with both gcc and clang; and also by verifying that -Wimplicit-fallthrough=3 is used in the gcc build. I will file a follow-up bug to convert the fall-through comments to a form that can be used by both clang and gcc. gdb/ChangeLog 2018-05-10 Tom Tromey * configure: Rebuild. * warning.m4 (AM_GDB_WARNINGS): Use -Wimplicit-fallthrough=3. gdb/gdbserver/ChangeLog 2018-05-10 Tom Tromey * configure: Rebuild. --- gdb/ChangeLog | 5 +++++ gdb/configure | 2 +- gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/configure | 2 +- gdb/warning.m4 | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/configure b/gdb/configure index 0eec780bd1..4186f7e160 100755 --- a/gdb/configure +++ b/gdb/configure @@ -15367,7 +15367,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-mismatched-tags \ -Wno-error=deprecated-register \ -Wsuggest-override \ --Wimplicit-fallthrough \ +-Wimplicit-fallthrough=3 \ -Wduplicated-cond" case "${host}" in diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index ac61ba3543..b2e2e8f955 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -7174,7 +7174,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-mismatched-tags \ -Wno-error=deprecated-register \ -Wsuggest-override \ --Wimplicit-fallthrough \ +-Wimplicit-fallthrough=3 \ -Wduplicated-cond" case "${host}" in diff --git a/gdb/warning.m4 b/gdb/warning.m4 index cb23472ec6..632cc214ac 100644 --- a/gdb/warning.m4 +++ b/gdb/warning.m4 @@ -44,7 +44,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wno-mismatched-tags \ -Wno-error=deprecated-register \ -Wsuggest-override \ --Wimplicit-fallthrough \ +-Wimplicit-fallthrough=3 \ -Wduplicated-cond" case "${host}" in