Use -Werror in frameworks/native/cmds
* Remove or comment out unused variables/functions.
Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I15a463eb9a20bc12787c104f671063ceeafaa1cc
diff --git a/cmds/lshal/Android.bp b/cmds/lshal/Android.bp
index 6cbe7e2..409c206 100644
--- a/cmds/lshal/Android.bp
+++ b/cmds/lshal/Android.bp
@@ -34,6 +34,10 @@
"TextTable.cpp",
"utils.cpp",
],
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
}
cc_defaults {
@@ -44,7 +48,8 @@
"libhidltransport",
"liblshal",
"libutils",
- ]
+ ],
+ cflags: ["-Wall", "-Werror"],
}
cc_binary {
diff --git a/cmds/lshal/Lshal.h b/cmds/lshal/Lshal.h
index 9f8eeaa..690f30e 100644
--- a/cmds/lshal/Lshal.h
+++ b/cmds/lshal/Lshal.h
@@ -62,7 +62,6 @@
Status parseArgs(const Arg &arg);
std::string mCommand;
- Arg mCmdArgs;
NullableOStream<std::ostream> mOut;
NullableOStream<std::ostream> mErr;
diff --git a/cmds/lshal/PipeRelay.cpp b/cmds/lshal/PipeRelay.cpp
index 54d19f6..fc40749 100644
--- a/cmds/lshal/PipeRelay.cpp
+++ b/cmds/lshal/PipeRelay.cpp
@@ -57,8 +57,7 @@
////////////////////////////////////////////////////////////////////////////////
PipeRelay::PipeRelay(std::ostream &os)
- : mOutStream(os),
- mInitCheck(NO_INIT) {
+ : mInitCheck(NO_INIT) {
int res = socketpair(AF_UNIX, SOCK_STREAM, 0 /* protocol */, mFds);
if (res < 0) {
diff --git a/cmds/lshal/PipeRelay.h b/cmds/lshal/PipeRelay.h
index 76b2b23..8dc3093 100644
--- a/cmds/lshal/PipeRelay.h
+++ b/cmds/lshal/PipeRelay.h
@@ -42,7 +42,6 @@
private:
struct RelayThread;
- std::ostream &mOutStream;
status_t mInitCheck;
int mFds[2];
sp<RelayThread> mThread;