Declare __fake_use_va_args as a variadic function.
* New clang compiler requires variadic function to have
at least one named parameter type.
* Use ##__VA_ARGS__ to work with empty __VA_ARGS__.
* Fix one ALOG_ASSERT parameter bug in lmkd/lmkd.c.
Bug: 111614304
Test: make with WITH_TIDY=1
Change-Id: I90f35aa88527a6897954f69a35b256a157a725c5
diff --git a/liblog/include/log/log_main.h b/liblog/include/log/log_main.h
index 9c68ff2..1314330 100644
--- a/liblog/include/log/log_main.h
+++ b/liblog/include/log/log_main.h
@@ -47,7 +47,8 @@
* so don't link with __clang_analyzer__ defined.
*/
#ifdef __clang_analyzer__
-extern void __FAKE_USE_VA_ARGS(...);
+extern void __fake_use_va_args(int, ...);
+#define __FAKE_USE_VA_ARGS(...) __fake_use_va_args(0, ##__VA_ARGS__)
#else
#define __FAKE_USE_VA_ARGS(...) ((void)(0))
#endif
diff --git a/lmkd/lmkd.c b/lmkd/lmkd.c
index 1cfef34..c2487d6 100644
--- a/lmkd/lmkd.c
+++ b/lmkd/lmkd.c
@@ -332,7 +332,7 @@
data->fd = -1;
return -1;
}
- ALOG_ASSERT((size_t)size < buf_size - 1, data->filename " too large");
+ ALOG_ASSERT((size_t)size < buf_size - 1, "%s too large", data->filename);
buf[size] = 0;
return 0;