Commit 9eb4cac1 authored by Nico Weber's avatar Nico Weber

Enable -Wextra-semi on Windows.

Requires suppressing the warning for a file generated by mc.exe,
and for a system header (which is arguably a clang bug, see comment
in the .h).

Bug: 926235
Change-Id: Iee8ecd6eab476207c1507719ba5102403f381cae
Reviewed-on: https://chromium-review.googlesource.com/c/1489102Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635689}
parent 5f5994a6
...@@ -30,8 +30,19 @@ ...@@ -30,8 +30,19 @@
// file. Note that this includes evntprov.h which requires a Vista+ Windows SDK. // file. Note that this includes evntprov.h which requires a Vista+ Windows SDK.
// //
// In SHARED_INTERMEDIATE_DIR. // In SHARED_INTERMEDIATE_DIR.
// Headers generated by mc.exe have a ';' at the end of extern "C" {} blocks.
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wextra-semi"
#endif
#include "base/trace_event/etw_manifest/chrome_events_win.h" // NOLINT #include "base/trace_event/etw_manifest/chrome_events_win.h" // NOLINT
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
namespace { namespace {
// |kFilteredEventGroupNames| contains the event categories that can be // |kFilteredEventGroupNames| contains the event categories that can be
......
...@@ -1590,7 +1590,7 @@ config("chromium_code") { ...@@ -1590,7 +1590,7 @@ config("chromium_code") {
# TODO(thakis): Enable this for more platforms, https://crbug.com/926235 # TODO(thakis): Enable this for more platforms, https://crbug.com/926235
has_dchecks = is_debug || dcheck_always_on has_dchecks = is_debug || dcheck_always_on
if (has_dchecks && (is_android || is_ios || is_linux || is_mac)) { if (has_dchecks && (is_android || is_ios || is_linux || is_mac || is_win)) {
cflags += [ "-Wextra-semi" ] cflags += [ "-Wextra-semi" ]
} }
} }
......
...@@ -100,8 +100,20 @@ class ATL_NO_VTABLE CGaiaCredentialProvider ...@@ -100,8 +100,20 @@ class ATL_NO_VTABLE CGaiaCredentialProvider
size_t index_ = std::numeric_limits<size_t>::max(); size_t index_ = std::numeric_limits<size_t>::max();
}; };
// OBJECT_ENTRY_AUTO() contains an extra semicolon.
// TODO(thakis): Make -Wextra-semi not warn on semicolons that are from a
// macro in a system header, then remove the pragma, https://llvm.org/PR40874
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wextra-semi"
#endif
OBJECT_ENTRY_AUTO(__uuidof(GaiaCredentialProvider), CGaiaCredentialProvider) OBJECT_ENTRY_AUTO(__uuidof(GaiaCredentialProvider), CGaiaCredentialProvider)
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
} // namespace credential_provider } // namespace credential_provider
#endif // CHROME_CREDENTIAL_PROVIDER_GAIACP_GAIA_CREDENTIAL_PROVIDER_H_ #endif // CHROME_CREDENTIAL_PROVIDER_GAIACP_GAIA_CREDENTIAL_PROVIDER_H_
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