Skip to content

Commit

Permalink
pw_build: Introduce config for enabling -Wshadow-all
Browse files Browse the repository at this point in the history
-Wshadow-all will be added to internal_strict_warnings in a later
change.

Change-Id: I2ddaa006e200ecfabfc1ef5606e2f49fa4e071b3
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/231651
Reviewed-by: Dave Roth <[email protected]>
Lint: Lint 🤖 <[email protected]>
Commit-Queue: Wyatt Hepler <[email protected]>
Pigweed-Auto-Submit: Wyatt Hepler <[email protected]>
  • Loading branch information
255 authored and CQ Bot Account committed Aug 26, 2024
1 parent dfc2231 commit 005ddff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pw_build/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ config("extra_strict_warnings") {
# This config MUST NOT be used downstream to allow for warnings to be
# added in the future without breaking downstream.
config("internal_strict_warnings") {
configs = [ ":internal_strict_warnings_core" ]
}

# Core flags from ":internal_strict_warnings" that are enabled throughout
# Pigweed. These are split out so ":shadow_all" can be disabled where needed.
config("internal_strict_warnings_core") {
cflags = [ "-Wswitch-enum" ]

if (is_clang) {
Expand All @@ -204,6 +210,13 @@ config("internal_strict_warnings") {
}
}

# Keep "-Wshadow-all" separate so it can be disabled individually.
config("shadow_all") {
if (is_clang) {
cflags = [ "-Wshadow-all" ]
}
}

config("pedantic_warnings") {
cflags = [
# Enable -Wpedantic, but disable a few warnings.
Expand Down

0 comments on commit 005ddff

Please sign in to comment.