Skip to content

Commit e678b3f

Browse files
DKLoehrcopybara-github
authored andcommitted
Update WSM format to be OS-agnostic
The warning suppression mapping is apparently sensitive to which path separator is used, and it isn't always consistent. To make sure we properly suppress things on windows, update the entries to match and combination of the separators. This CL also re-enables the warning on windows, since we're now suppressing it properly via the WSM. Bug: 425364464 Change-Id: Ie7804e3b02bdc144987492634250018629bf77e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6653054 Reviewed-by: Arthur Eubanks <[email protected]> Commit-Queue: Devon Loehr <[email protected]> Cr-Commit-Position: refs/heads/main@{#1475806} NOKEYCHECK=True GitOrigin-RevId: 26d51346374a0d16b0ba2243ef83c015a944d975
1 parent 4334bbf commit e678b3f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

config/compiler/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2161,7 +2161,7 @@ config("default_warnings") {
21612161
]
21622162
}
21632163

2164-
if (is_component_build && use_clang_warning_suppression_file && !is_win) {
2164+
if (is_component_build && use_clang_warning_suppression_file) {
21652165
# Warn for globally unique objects which might get duplicated if built
21662166
# into different components, due to hidden visibility. Only applicable
21672167
# to component builds.

config/warning_suppression.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,19 @@
2929
# We may make an exception to the policy for extremely high-value warnings that backslide a lot
3030
# (such as unsafe buffers), but this is expected to be rare.
3131

32-
# Formatting note: Don't put comments on the same line as a glob pattern! Clang
33-
# will get confused and the warning won't be suppressed.
32+
# Formatting Notes:
33+
# 1. Don't put comments on the same line as a glob pattern! Clang will get confused,
34+
# and the warning won't be suppressed.
35+
# 2. The syntax {/,\\} matches either a backslash or forward slash. They can sometimes
36+
# be intermixed in a single path when compiling on Windows.
3437

3538
[unnecessary-virtual-specifier]
3639
# Can be removed when https://github.com/google/nearby/pull/3392 is merged and rolled
37-
src:*/third_party/nearby/*
40+
src:*{/,\\}third_party{/,\\}nearby{/,\\}*
3841

3942
[unique-object-duplication]
4043
# This warning is extremely difficult to fix in code we don't directly control.
4144
# As an experiment, we're breaking the policy and suppressing it permanently.
42-
src:*/third_party/*
45+
src:*{/,\\}third_party{/,\\}*
4346
# v8's build system isn't amenable to fixes: https://crbug.com/408259026
44-
src:*/v8/*
47+
src:*{/,\\}v8{/,\\}*

0 commit comments

Comments
 (0)