Use -Werror in frameworks/native/libs/vr
* Suppress/fix warnings of unused variable, parameter,
private-field, and function.
* Fix warnings about typedef missing declarator.
* Use -Wno-error to keep existing warnings, to fix later.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Ifb82fcd76fcb5d9c9d9f017f2541581661493bd5
diff --git a/services/vr/hardware_composer/Android.bp b/services/vr/hardware_composer/Android.bp
index 5cb201d..88a5a611 100644
--- a/services/vr/hardware_composer/Android.bp
+++ b/services/vr/hardware_composer/Android.bp
@@ -43,6 +43,11 @@
cflags: [
"-DLOG_TAG=\"vr_hwc\"",
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // fix later
+ "-Wno-unused-private-field",
+ "-Wno-unused-parameter",
],
}
@@ -56,6 +61,7 @@
"aidl/android/dvr/parcelable_composer_layer.cpp",
"aidl/android/dvr/parcelable_unique_fd.cpp",
],
+ cflags: ["-Wall", "-Werror"],
aidl: {
include_dirs: ["frameworks/native/services/vr/hardware_composer/aidl"],
export_aidl_headers: true,
@@ -91,6 +97,8 @@
],
cflags: [
"-DLOG_TAG=\"vr_hwc\"",
+ "-Wall",
+ "-Werror",
],
}
@@ -119,6 +127,8 @@
],
cflags: [
"-DLOG_TAG=\"vr_hwc\"",
+ "-Wall",
+ "-Werror",
],
init_rc: [
"vr_hwc.rc",
@@ -129,6 +139,12 @@
name: "vr_hwc_test",
gtest: true,
srcs: ["tests/vr_composer_test.cpp"],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // fix later
+ "-Wno-unused-parameter",
+ ],
static_libs: [
"libgtest",
"libvr_hwc-impl",
diff --git a/services/vr/virtual_touchpad/Android.bp b/services/vr/virtual_touchpad/Android.bp
index 3d5dfb2..919d124 100644
--- a/services/vr/virtual_touchpad/Android.bp
+++ b/services/vr/virtual_touchpad/Android.bp
@@ -18,7 +18,11 @@
export_include_dirs: ["include"],
shared_libs: shared_libs,
cppflags: ["-std=c++11"],
- cflags: ["-DLOG_TAG=\"VrVirtualTouchpad\""],
+ cflags: [
+ "-DLOG_TAG=\"VrVirtualTouchpad\"",
+ "-Wall",
+ "-Werror",
+ ],
name: "libvirtualtouchpad",
tags: ["optional"],
}
@@ -51,6 +55,12 @@
name: "VirtualTouchpad_test",
stl: "libc++_static",
tags: [ "optional" ],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-function",
+ "-Wno-unused-variable",
+ ],
}
// Service.
@@ -80,6 +90,8 @@
cppflags: ["-std=c++11"],
cflags: [
"-DLOG_TAG=\"VrVirtualTouchpad\"",
+ "-Wall",
+ "-Werror",
],
host_ldlibs: ["-llog"],
name: "virtual_touchpad",
@@ -108,7 +120,11 @@
srcs: client_src,
shared_libs: client_shared_libs,
cppflags: ["-std=c++11"],
- cflags: ["-DLOG_TAG=\"VirtualTouchpadClient\""],
+ cflags: [
+ "-DLOG_TAG=\"VirtualTouchpadClient\"",
+ "-Wall",
+ "-Werror",
+ ],
host_ldlibs: ["-llog"],
name: "libvirtualtouchpadclient",
tags: ["optional"],