This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Fix the clang build
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 10 May 2018 11:16:44 -0400
- Subject: Re: [RFA] Fix the clang build
- References: <20180510144039.9474-1-tom@tromey.com>
On 2018-05-10 10:40, Tom Tromey wrote:
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.
Thanks, that patch is fine with me.
To be clear for those who might not be aware of the mechanism: the
configure script tests each warning flag to see if it's supported by the
current compiler. Since -Wimplicit-fallthrough=3 is not supported by
clang, it won't be included. This means that we won't get the
fallthrough warnings when building with clang. I think it's fine, since
we get them through gcc, so an unintended fallthrough would be found
pretty quickly anyway.
Simon