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 bfd6e5e commit e0375d0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 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,16 @@ 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") {
cflags += [ "-Wundef" ]
}

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

0 comments on commit e0375d0

Please sign in to comment.