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
This commit is contained in:
Chih-Hung Hsieh 2018-07-25 12:15:25 -07:00
parent 56795ac483
commit 62b0ef556d
2 changed files with 3 additions and 2 deletions

View File

@ -47,7 +47,8 @@ __BEGIN_DECLS
* 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

View File

@ -332,7 +332,7 @@ static int reread_file(struct reread_data *data, char *buf, size_t buf_size) {
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;