Skip to content

Commit

Permalink
Restrict -Wundef to where it actually passes CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky-apple committed Oct 5, 2023
1 parent d69787e commit 64f973e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ config("strict_warnings") {
cflags = [
"-Wextra",
"-Wshadow",
"-Wundef",
"-Wunreachable-code",
"-Wvla",
"-Wformat",
Expand All @@ -254,6 +253,20 @@ config("strict_warnings") {
cflags += [ "-Wconversion" ]
}

# For now we can't enable -Wundef across the board. Enable it where
# we can. Ideally this would be checking chip_device_platform or so
# to be more fine-grained than current_os, but it's not clear that
# we can access that here.
if (current_os != "android" && current_os != "freertos" &&
current_os != "linux" && current_os != "mbed" && current_os != "tizen" &&
current_os != "zephyr" &&
# cmsis-rtos is OpenIOT
current_os != "cmsis-rtos" &&
# cyw30739 is one of the Infineon builds
current_os != "cyw30739") {
cflags += [ "-Wundef" ]
}

if (matter_enable_java_compilation) {
cflags -= [ "-Wshadow" ]
}
Expand Down

0 comments on commit 64f973e

Please sign in to comment.