summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2017-10-05 14:27:38 -0700
committerChih-Hung Hsieh <chh@google.com>2017-10-11 15:14:55 -0700
commit38a11928990e62b263abe2dada0ff1f43d878e7c (patch)
tree02cf1e9f3990a17a74b26e834994400cd8658186
parent6cfabaeb66753867751864ca97398bfea89faa09 (diff)
downloadnative-38a11928990e62b263abe2dada0ff1f43d878e7c.tar.gz
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
-rw-r--r--libs/vr/libbufferhub/Android.bp8
-rw-r--r--libs/vr/libbufferhubqueue/Android.bp5
-rw-r--r--libs/vr/libbufferhubqueue/tests/Android.bp6
-rw-r--r--libs/vr/libdisplay/Android.bp2
-rw-r--r--libs/vr/libdisplay/include/dvr/dvr_display_types.h2
-rw-r--r--libs/vr/libdvr/Android.bp2
-rw-r--r--libs/vr/libdvr/tests/Android.bp5
-rw-r--r--libs/vr/libdvrcommon/Android.bp7
-rw-r--r--libs/vr/libperformance/Android.bp4
-rw-r--r--libs/vr/libvrflinger/Android.bp4
-rw-r--r--libs/vr/libvrsensor/Android.bp4
-rw-r--r--libs/vr/libvrsensor/include/dvr/pose_client.h2
-rw-r--r--services/vr/hardware_composer/Android.bp16
-rw-r--r--services/vr/virtual_touchpad/Android.bp20
14 files changed, 82 insertions, 5 deletions
diff --git a/libs/vr/libbufferhub/Android.bp b/libs/vr/libbufferhub/Android.bp
index 17725f85a8..2819fe92a1 100644
--- a/libs/vr/libbufferhub/Android.bp
+++ b/libs/vr/libbufferhub/Android.bp
@@ -42,6 +42,9 @@ cc_library {
"-DLOG_TAG=\"libbufferhub\"",
"-DTRACE=0",
"-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // to fix later
],
export_include_dirs: localIncludeFiles,
static_libs: staticLibraries,
@@ -55,5 +58,10 @@ cc_test {
static_libs: ["libbufferhub"] + staticLibraries,
shared_libs: sharedLibraries,
name: "bufferhub_tests",
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // to fix later
+ ],
}
diff --git a/libs/vr/libbufferhubqueue/Android.bp b/libs/vr/libbufferhubqueue/Android.bp
index a7c33ee3fb..efd5cc79df 100644
--- a/libs/vr/libbufferhubqueue/Android.bp
+++ b/libs/vr/libbufferhubqueue/Android.bp
@@ -48,6 +48,11 @@ cc_library {
"-DLOG_TAG=\"libbufferhubqueue\"",
"-DTRACE=0",
"-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // to fix later
+ "-Wno-unused-parameter",
+ "-Wno-unused-variable",
],
srcs: sourceFiles,
export_include_dirs: includeFiles,
diff --git a/libs/vr/libbufferhubqueue/tests/Android.bp b/libs/vr/libbufferhubqueue/tests/Android.bp
index 865573cafd..21a675f29e 100644
--- a/libs/vr/libbufferhubqueue/tests/Android.bp
+++ b/libs/vr/libbufferhubqueue/tests/Android.bp
@@ -28,6 +28,9 @@ cc_test {
"-DTRACE=0",
"-O0",
"-g",
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // to fix later
],
name: "buffer_hub_queue-test",
tags: ["optional"],
@@ -42,6 +45,9 @@ cc_test {
"-DTRACE=0",
"-O0",
"-g",
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // to fix later
],
name: "buffer_hub_queue_producer-test",
tags: ["optional"],
diff --git a/libs/vr/libdisplay/Android.bp b/libs/vr/libdisplay/Android.bp
index d90521a810..abc8159a9b 100644
--- a/libs/vr/libdisplay/Android.bp
+++ b/libs/vr/libdisplay/Android.bp
@@ -55,6 +55,8 @@ cc_library {
"-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
"-DGL_GLEXT_PROTOTYPES",
"-DEGL_EGLEXT_PROTOTYPES",
+ "-Wall",
+ "-Werror",
], // + [ "-UNDEBUG", "-DDEBUG", "-O0", "-g" ],
export_include_dirs: localIncludeFiles,
shared_libs: sharedLibraries,
diff --git a/libs/vr/libdisplay/include/dvr/dvr_display_types.h b/libs/vr/libdisplay/include/dvr/dvr_display_types.h
index 25364d8590..fd69843292 100644
--- a/libs/vr/libdisplay/include/dvr/dvr_display_types.h
+++ b/libs/vr/libdisplay/include/dvr/dvr_display_types.h
@@ -13,7 +13,7 @@ __BEGIN_DECLS
#ifndef __FLOAT32X4T_86
#define __FLOAT32X4T_86
typedef float float32x4_t __attribute__((__vector_size__(16)));
-typedef struct float32x4x4_t { float32x4_t val[4]; };
+typedef struct float32x4x4_t { float32x4_t val[4]; } float32x4x4_t;
#endif
#endif
diff --git a/libs/vr/libdvr/Android.bp b/libs/vr/libdvr/Android.bp
index 7a7c8aa5ee..65123d6075 100644
--- a/libs/vr/libdvr/Android.bp
+++ b/libs/vr/libdvr/Android.bp
@@ -22,6 +22,8 @@ cc_library_headers {
cflags = [
"-DLOG_TAG=\"libdvr\"",
"-DTRACE=0",
+ "-Wall",
+ "-Werror",
]
srcs = [
diff --git a/libs/vr/libdvr/tests/Android.bp b/libs/vr/libdvr/tests/Android.bp
index ef746e207a..21e9643956 100644
--- a/libs/vr/libdvr/tests/Android.bp
+++ b/libs/vr/libdvr/tests/Android.bp
@@ -48,6 +48,11 @@ cc_test {
"-DTRACE=0",
"-O0",
"-g",
+ "-Wall",
+ "-Werror",
+ "-Wno-error=macro-redefined", // to fix later
+ "-Wno-error=sign-compare", // to fix later
+ "-Wno-unused-variable",
],
name: "dvr_api-test",
}
diff --git a/libs/vr/libdvrcommon/Android.bp b/libs/vr/libdvrcommon/Android.bp
index 527cdbdd2a..8d2becaf4a 100644
--- a/libs/vr/libdvrcommon/Android.bp
+++ b/libs/vr/libdvrcommon/Android.bp
@@ -40,6 +40,8 @@ cc_library {
cflags: [
"-DLOG_TAG=\"libdvrcommon\"",
"-DTRACE=0",
+ "-Wall",
+ "-Werror",
],
export_include_dirs: localIncludeFiles,
@@ -59,6 +61,11 @@ cc_test {
tags: ["optional"],
srcs: testFiles,
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
shared_libs: sharedLibraries,
diff --git a/libs/vr/libperformance/Android.bp b/libs/vr/libperformance/Android.bp
index 364873dae2..6a4687629e 100644
--- a/libs/vr/libperformance/Android.bp
+++ b/libs/vr/libperformance/Android.bp
@@ -32,7 +32,9 @@ cc_library {
srcs: sourceFiles,
cflags: [
"-DLOG_TAG=\"libperformance\"",
- "-DTRACE=0"
+ "-DTRACE=0",
+ "-Wall",
+ "-Werror",
],
export_include_dirs: includeFiles,
static_libs: staticLibraries,
diff --git a/libs/vr/libvrflinger/Android.bp b/libs/vr/libvrflinger/Android.bp
index de26a74f48..f2c88ad604 100644
--- a/libs/vr/libvrflinger/Android.bp
+++ b/libs/vr/libvrflinger/Android.bp
@@ -71,6 +71,10 @@ cc_library_static {
"-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
"-DGL_GLEXT_PROTOTYPES",
"-DEGL_EGLEXT_PROTOTYPES",
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // to fix later
+ "-Wno-unused-variable",
],
shared_libs: sharedLibraries,
whole_static_libs: staticLibraries,
diff --git a/libs/vr/libvrsensor/Android.bp b/libs/vr/libvrsensor/Android.bp
index abad78b338..1a15b6a571 100644
--- a/libs/vr/libvrsensor/Android.bp
+++ b/libs/vr/libvrsensor/Android.bp
@@ -40,6 +40,10 @@ sharedLibraries = [
cc_library {
srcs: sourceFiles,
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
export_include_dirs: includeFiles,
static_libs: staticLibraries,
shared_libs: sharedLibraries,
diff --git a/libs/vr/libvrsensor/include/dvr/pose_client.h b/libs/vr/libvrsensor/include/dvr/pose_client.h
index ed75f84216..d32df64391 100644
--- a/libs/vr/libvrsensor/include/dvr/pose_client.h
+++ b/libs/vr/libvrsensor/include/dvr/pose_client.h
@@ -7,7 +7,7 @@
#ifndef __FLOAT32X4T_86
#define __FLOAT32X4T_86
typedef float float32x4_t __attribute__ ((__vector_size__ (16)));
-typedef struct float32x4x4_t { float32x4_t val[4]; };
+typedef struct float32x4x4_t { float32x4_t val[4]; } float32x4x4_t;
#endif
#endif
diff --git a/services/vr/hardware_composer/Android.bp b/services/vr/hardware_composer/Android.bp
index 5cb201ded3..88a5a611c6 100644
--- a/services/vr/hardware_composer/Android.bp
+++ b/services/vr/hardware_composer/Android.bp
@@ -43,6 +43,11 @@ cc_library_shared {
cflags: [
"-DLOG_TAG=\"vr_hwc\"",
+ "-Wall",
+ "-Werror",
+ "-Wno-error=sign-compare", // fix later
+ "-Wno-unused-private-field",
+ "-Wno-unused-parameter",
],
}
@@ -56,6 +61,7 @@ cc_library_static {
"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 @@ cc_library_static {
],
cflags: [
"-DLOG_TAG=\"vr_hwc\"",
+ "-Wall",
+ "-Werror",
],
}
@@ -119,6 +127,8 @@ cc_binary {
],
cflags: [
"-DLOG_TAG=\"vr_hwc\"",
+ "-Wall",
+ "-Werror",
],
init_rc: [
"vr_hwc.rc",
@@ -129,6 +139,12 @@ cc_test {
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 3d5dfb271a..919d12423c 100644
--- a/services/vr/virtual_touchpad/Android.bp
+++ b/services/vr/virtual_touchpad/Android.bp
@@ -18,7 +18,11 @@ cc_library {
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 @@ cc_test {
name: "VirtualTouchpad_test",
stl: "libc++_static",
tags: [ "optional" ],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-function",
+ "-Wno-unused-variable",
+ ],
}
// Service.
@@ -80,6 +90,8 @@ cc_binary {
cppflags: ["-std=c++11"],
cflags: [
"-DLOG_TAG=\"VrVirtualTouchpad\"",
+ "-Wall",
+ "-Werror",
],
host_ldlibs: ["-llog"],
name: "virtual_touchpad",
@@ -108,7 +120,11 @@ cc_library {
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"],