summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Pierre-Clément Tosi <ptosi@google.com> 2023-10-11 15:50:39 +0100
committer Pierre-Clément Tosi <ptosi@google.com> 2023-10-11 16:02:56 +0100
commit170bf1d4ce7ba36cc7b8b0f606ae9c169ea9a769 (patch)
tree8a40c4f9b84fa7cd74ca92be31880cb7da83edb2
parent6c25e96cf6d6969d580f178e9e48f396249b50b8 (diff)
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
-rw-r--r--Android.bp11
-rw-r--r--BUILD.bazel24
-rw-r--r--libfdt/Android.bp7
3 files changed, 20 insertions, 22 deletions
diff --git a/Android.bp b/Android.bp
index a194eef..85c1b22 100644
--- a/Android.bp
+++ b/Android.bp
@@ -44,14 +44,21 @@ license {
}
cc_defaults {
- name: "dt_defaults",
+ name: "dtc_cflags_defaults",
cflags: [
"-Wall",
"-Werror",
"-Wno-macro-redefined",
- "-Wno-sign-compare",
"-Wno-missing-field-initializers",
+ "-Wno-sign-compare",
"-Wno-unused-parameter",
+ ],
+}
+
+cc_defaults {
+ name: "dt_defaults",
+ defaults: ["dtc_cflags_defaults"],
+ cflags: [
"-DNO_YAML"
],
diff --git a/BUILD.bazel b/BUILD.bazel
index 5ef46e7..d9fdb9a 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1,26 +1,22 @@
+COPTS = [
+ "-Wall",
+ "-Werror",
+ "-Wno-macro-redefined",
+ "-Wno-missing-field-initializers",
+ "-Wno-sign-compare",
+ "-Wno-unused-parameter",
+]
+
cc_library(
name = "libfdt",
srcs = glob([
"libfdt/*.h",
"libfdt/*.c",
]),
- copts = [
- "-Werror",
- "-Wno-macro-redefined",
- "-Wno-sign-compare",
- ],
+ copts = COPTS,
includes = ["libfdt"],
)
-COPTS = [
- "-Wall",
- "-Werror",
- "-Wno-macro-redefined",
- "-Wno-sign-compare",
- "-Wno-missing-field-initializers",
- "-Wno-unused-parameter",
-]
-
genrule(
name = "lexer",
srcs = [
diff --git a/libfdt/Android.bp b/libfdt/Android.bp
index 8f4bdfd..0bf631a 100644
--- a/libfdt/Android.bp
+++ b/libfdt/Android.bp
@@ -7,12 +7,7 @@ package {
cc_library {
name: "libfdt",
host_supported: true,
-
- cflags: [
- "-Werror",
- "-Wno-macro-redefined",
- "-Wno-sign-compare",
- ],
+ defaults: ["dtc_cflags_defaults"],
srcs: [
"fdt.c",
"fdt_check.c",