Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [RFA] Fix the clang build
Date: Thu, 10 May 2018 15:05:00 -0000	[thread overview]
Message-ID: <20180510144039.9474-1-tom@tromey.com> (raw)

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  <tom@tromey.com>

	* configure: Rebuild.
	* warning.m4 (AM_GDB_WARNINGS): Use -Wimplicit-fallthrough=3.

gdb/gdbserver/ChangeLog
2018-05-10  Tom Tromey  <tom@tromey.com>

	* 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
-- 
2.13.6


             reply	other threads:[~2018-05-10 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 15:05 Tom Tromey [this message]
2018-05-10 16:47 ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180510144039.9474-1-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox