From 9aaccbc6fded1b3cfb7c9521665b8b7162f2150f Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 30 Jan 2023 19:04:33 +0000 Subject: AOSP: Android: consolidate warning suppressions For warnings not supported by upstream e2fsprogs, it's a waste of time to suppress them only in specific places, as they can show up anywhere in future releases of e2fsprogs. Let's consolidate all these warning suppressions into the top-level Android.bp for e2fsprogs. Change-Id: Icebc03289dae920cb1b673e605c48f7f2b517625 From AOSP commit: d08d59557a34c6362e3660e7e35bc118591dbbfa --- Android.bp | 20 +++++++++++++------- e2fsck/Android.bp | 3 --- lib/blkid/Android.bp | 8 -------- lib/e2p/Android.bp | 7 ------- lib/ext2fs/Android.bp | 4 ---- lib/uuid/Android.bp | 3 --- misc/Android.bp | 4 ---- 7 files changed, 13 insertions(+), 36 deletions(-) diff --git a/Android.bp b/Android.bp index ae145209..38b9bef3 100644 --- a/Android.bp +++ b/Android.bp @@ -42,14 +42,20 @@ license { cc_defaults { name: "e2fsprogs-defaults", - cflags: ["-Wall", "-Werror", "-Wno-pointer-arith"], + cflags: [ + "-Wall", + "-Werror", + // Some warnings that Android's build system enables by default are not + // supported by upstream e2fsprogs. When such a warning shows up, + // disable it below. Please don't disable warnings that upstream + // e2fsprogs is supposed to support; for those, fix the code instead. + "-Wno-pointer-arith", + "-Wno-sign-compare", + "-Wno-type-limits", + "-Wno-typedef-redefinition", + "-Wno-unused-parameter", + ], target: { - windows: { - cflags: [ - "-Wno-typedef-redefinition", - "-Wno-unused-parameter", - ], - }, bionic: { system_shared_libs: ["libc", "libdl"], }, diff --git a/e2fsck/Android.bp b/e2fsck/Android.bp index ad2e4354..b42de9d7 100644 --- a/e2fsck/Android.bp +++ b/e2fsck/Android.bp @@ -47,9 +47,6 @@ cc_defaults { "extents.c", "encrypted_files.c", ], - cflags: [ - "-Wno-sign-compare", - ], } e2fsck_libs = [ diff --git a/lib/blkid/Android.bp b/lib/blkid/Android.bp index cf205163..891c74a3 100644 --- a/lib/blkid/Android.bp +++ b/lib/blkid/Android.bp @@ -39,18 +39,10 @@ cc_library { target: { windows: { - cflags: [ - "-Wno-error=typedef-redefinition", - ], - enabled: true, }, }, - cflags: [ - "-Wno-unused-parameter", - ], - header_libs: ["libext2-headers"], export_include_dirs: ["."], export_header_lib_headers: ["libext2-headers"], diff --git a/lib/e2p/Android.bp b/lib/e2p/Android.bp index 6cfdcda7..bed92c12 100644 --- a/lib/e2p/Android.bp +++ b/lib/e2p/Android.bp @@ -46,16 +46,9 @@ cc_library { "percent.c", ], - cflags: [ - "-Wno-unused-parameter", - ], - target: { windows: { enabled: true, - cflags: [ - "-Wno-error=typedef-redefinition", - ], }, }, diff --git a/lib/ext2fs/Android.bp b/lib/ext2fs/Android.bp index 5ed7aec1..db8b3b7e 100644 --- a/lib/ext2fs/Android.bp +++ b/lib/ext2fs/Android.bp @@ -112,7 +112,6 @@ cc_library { "libsparse", "libz", ], - cflags: ["-Wno-unused-parameter"], target: { android: { shared_libs: ["libext2_uuid"], @@ -121,9 +120,6 @@ cc_library { enabled: true, srcs: ["windows_io.c"], exclude_srcs: ["unix_io.c"], - cflags: [ - "-Wno-error=typedef-redefinition", - ], }, }, diff --git a/lib/uuid/Android.bp b/lib/uuid/Android.bp index 596b20a8..f8f07603 100644 --- a/lib/uuid/Android.bp +++ b/lib/uuid/Android.bp @@ -39,9 +39,6 @@ cc_library { "unparse.c", "uuid_time.c", ], - cflags: [ - "-Wno-unused-parameter", - ], target: { windows: { enabled: true diff --git a/misc/Android.bp b/misc/Android.bp index 70c20416..083ae689 100644 --- a/misc/Android.bp +++ b/misc/Android.bp @@ -51,10 +51,6 @@ cc_defaults { "mk_hugefiles.c", "default_profile.c", ], - cflags: [ - "-Wno-error=type-limits", - ], - stl: "libc++_static", include_dirs: ["external/e2fsprogs/e2fsck"], } -- cgit v1.2.1