ANDROID: Use -Wall and more when building libfdt

Build libfdt with the same warnings as the DTC tools. This effectively
starts using -Wno-missing-field-initializers, -Wno-unused-parameter, and
-Wall.

Test: m libfdt
Test: bazel build //:libfdt
Change-Id: I5a2ae1ee86b4613d0aa7a0174d235976d7be45cc
This commit is contained in:
Pierre-Clément Tosi 2023-10-11 15:50:39 +01:00
parent 6c25e96cf6
commit 170bf1d4ce
3 changed files with 20 additions and 22 deletions

View file

@ -44,14 +44,21 @@ license {
} }
cc_defaults { cc_defaults {
name: "dt_defaults", name: "dtc_cflags_defaults",
cflags: [ cflags: [
"-Wall", "-Wall",
"-Werror", "-Werror",
"-Wno-macro-redefined", "-Wno-macro-redefined",
"-Wno-sign-compare",
"-Wno-missing-field-initializers", "-Wno-missing-field-initializers",
"-Wno-sign-compare",
"-Wno-unused-parameter", "-Wno-unused-parameter",
],
}
cc_defaults {
name: "dt_defaults",
defaults: ["dtc_cflags_defaults"],
cflags: [
"-DNO_YAML" "-DNO_YAML"
], ],

View file

@ -1,26 +1,22 @@
COPTS = [
"-Wall",
"-Werror",
"-Wno-macro-redefined",
"-Wno-missing-field-initializers",
"-Wno-sign-compare",
"-Wno-unused-parameter",
]
cc_library( cc_library(
name = "libfdt", name = "libfdt",
srcs = glob([ srcs = glob([
"libfdt/*.h", "libfdt/*.h",
"libfdt/*.c", "libfdt/*.c",
]), ]),
copts = [ copts = COPTS,
"-Werror",
"-Wno-macro-redefined",
"-Wno-sign-compare",
],
includes = ["libfdt"], includes = ["libfdt"],
) )
COPTS = [
"-Wall",
"-Werror",
"-Wno-macro-redefined",
"-Wno-sign-compare",
"-Wno-missing-field-initializers",
"-Wno-unused-parameter",
]
genrule( genrule(
name = "lexer", name = "lexer",
srcs = [ srcs = [

View file

@ -7,12 +7,7 @@ package {
cc_library { cc_library {
name: "libfdt", name: "libfdt",
host_supported: true, host_supported: true,
defaults: ["dtc_cflags_defaults"],
cflags: [
"-Werror",
"-Wno-macro-redefined",
"-Wno-sign-compare",
],
srcs: [ srcs: [
"fdt.c", "fdt.c",
"fdt_check.c", "fdt_check.c",