Enable clang-tidy for clatd.
Enable the same warnings used elsewhere in the tree, and fix two
warnings it found (a safe use of strcpy, and a missing O_CLOEXEC
when opening the tun device node.
Test: builds, boots, clatd works
Test: m clatd clatd_test clatd_microbenchmark && atest clatd_test
Change-Id: I9a5ea4de5f31d3c495871250a6493b07535a604b
diff --git a/Android.bp b/Android.bp
index e0eeb2e..98b4010 100644
--- a/Android.bp
+++ b/Android.bp
@@ -54,6 +54,20 @@
"liblog",
"libnetutils",
],
+
+ // Only enable clang-tidy for the daemon, not the tests, because enabling it for the
+ // tests substantially increases build/compile cycle times and doesn't really provide a
+ // security benefit.
+ tidy: true,
+ tidy_checks: [
+ "-*",
+ "cert-*",
+ "clang-analyzer-security*",
+ "android-*",
+ ],
+ tidy_flags: [
+ "-warnings-as-errors=clang-analyzer-security*,cert-*,android-*",
+ ],
}
// The configuration file.