Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 122352d9 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Use -Werror in system/core

* Move -Wall -Werror from cppflags to cflags.
* Fix/suppress warning on unused variables.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I1e05e96a1d0bcb2ccef1ce456504b3af57167cc5
parent 15251c24
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -14,11 +14,10 @@
// limitations under the License.
//

libbase_cppflags = [
    "-Wall",
    "-Wextra",
    "-Werror",
]
cc_defaults {
    name: "libbase_defaults",
    cflags: ["-Wall", "-Werror", "-Wextra"],
}

cc_library_headers {
    name: "libbase_headers",
@@ -38,6 +37,7 @@ cc_library_headers {

cc_library {
    name: "libbase",
    defaults: ["libbase_defaults"],
    vendor_available: true,
    host_supported: true,
    vndk: {
@@ -59,7 +59,6 @@ cc_library {
    ],
    export_header_lib_headers: ["libbase_headers"],

    cppflags: libbase_cppflags,
    shared_libs: ["liblog"],
    target: {
        android: {
@@ -102,6 +101,7 @@ cc_library {
// ------------------------------------------------------------------------------
cc_test {
    name: "libbase_test",
    defaults: ["libbase_defaults"],
    host_supported: true,
    srcs: [
        "endian_test.cpp",
@@ -133,7 +133,6 @@ cc_test {
        },
    },
    local_include_dirs: ["."],
    cppflags: libbase_cppflags,
    shared_libs: ["libbase"],
    compile_multilib: "both",
    multilib: {
+1 −1
Original line number Diff line number Diff line
cc_defaults {
    name: "crasher-defaults",

    cppflags: [
    cflags: [
        "-W",
        "-Wall",
        "-Wextra",
+5 −1
Original line number Diff line number Diff line
@@ -20,7 +20,11 @@ cc_defaults {
        misc_undefined: ["integer"],
    },
    local_include_dirs: ["include/"],
    cppflags: ["-Werror"],
    cflags: [
        "-Wall",
        "-Werror",
        "-Wno-unused-variable",
    ],
}

cc_library_static {
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ cc_defaults {
    sanitize: {
        misc_undefined: ["signed-integer-overflow"],
    },
    cppflags: [
    cflags: [
        "-DLOG_UEVENTS=0",
        "-Wall",
        "-Wextra",
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
cc_binary {
    name: "test_service",
    srcs: ["test_service.cpp"],
    cflags: ["-Wall", "-Werror"],
    shared_libs: ["libbase"],
    init_rc: ["test_service.rc"],
}
Loading