Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62b0ef55 authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

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
parent 56795ac4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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;