Commit afb8aec0 authored by Nico Weber's avatar Nico Weber

Enable -Wimplicit-fallthrough for linux debug too.

Bug: 177475
Change-Id: I7985f9356fcac3c4c2e05fc3cdda0b52d132c7c7
Reviewed-on: https://chromium-review.googlesource.com/896718
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarJosh Karlin <jkarlin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533817}
parent e1556a02
......@@ -1427,7 +1427,7 @@ config("chromium_code") {
# Warn on missing break statements at the end of switch cases.
# For intentional fallthrough, use FALLTHROUGH; from base/compiler_specific.h
# TODO(thakis): Enable for all platforms, https://crbug.com/177475
if (is_clang && is_linux && !is_debug && !is_chromecast && !use_ozone) {
if (is_clang && is_linux && !is_chromecast && !use_ozone) {
cflags += [ "-Wimplicit-fallthrough" ]
}
......
......@@ -83,10 +83,15 @@ enum CrashLocation {
};
#ifndef NDEBUG
void TerminateSelf() {
[[noreturn]] void TerminateSelf() {
#if defined(OS_WIN)
// Windows does more work on _exit() than we would like, so we force exit.
TerminateProcess(GetCurrentProcess(), 0);
#if defined(__clang__)
// Let clang know that TerminateProcess(GetCurrentProcess()) can't return,
// so that it doesn't warn about TerminateSelf() returning.
__builtin_unreachable();
#endif
#elif defined(OS_POSIX)
// On POSIX, _exit() will terminate the process with minimal cleanup,
// and it is cleaner than killing.
......
......@@ -45,7 +45,7 @@ void AtomicHTMLToken::Show() const {
case HTMLToken::kEndTag:
if (self_closing_)
printf(" selfclosing");
/* FALL THROUGH */
FALLTHROUGH;
case HTMLToken::DOCTYPE:
printf(" name \"%s\"", name_.GetString().Utf8().data());
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment