Whamcloud - gitweb
AOSP: Android: consolidate warning suppressions
authorEric Biggers <ebiggers@google.com>
Mon, 30 Jan 2023 19:04:33 +0000 (19:04 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 1 Feb 2023 05:27:32 +0000 (00:27 -0500)
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
e2fsck/Android.bp
lib/blkid/Android.bp
lib/e2p/Android.bp
lib/ext2fs/Android.bp
lib/uuid/Android.bp
misc/Android.bp

index ae14520..38b9bef 100644 (file)
@@ -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"],
         },
index ad2e435..b42de9d 100644 (file)
@@ -47,9 +47,6 @@ cc_defaults {
         "extents.c",
         "encrypted_files.c",
     ],
-    cflags: [
-        "-Wno-sign-compare",
-    ],
 }
 
 e2fsck_libs = [
index cf20516..891c74a 100644 (file)
@@ -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"],
index 6cfdcda..bed92c1 100644 (file)
@@ -46,16 +46,9 @@ cc_library {
         "percent.c",
     ],
 
-    cflags: [
-        "-Wno-unused-parameter",
-    ],
-
     target: {
         windows: {
             enabled: true,
-            cflags: [
-                "-Wno-error=typedef-redefinition",
-            ],
         },
     },
 
index 5ed7aec..db8b3b7 100644 (file)
@@ -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",
-            ],
         },
     },
 
index 596b20a..f8f0760 100644 (file)
@@ -39,9 +39,6 @@ cc_library {
         "unparse.c",
         "uuid_time.c",
     ],
-    cflags: [
-        "-Wno-unused-parameter",
-    ],
     target: {
         windows: {
             enabled: true
index 70c2041..083ae68 100644 (file)
@@ -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"],
 }