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

Commit 67f72bde authored by Chih-Hung Hsieh's avatar Chih-Hung Hsieh
Browse files

Declare __FAKE_USE_VA_ARGS as a variadic function.

This avoids 2 static analysis warnings:
* assigned but unused variables in __VA_ARGS__
* unused expression result in __VA_ARGS__

Bug: 111614304
Test: make with WITH_TIDY=1
Change-Id: I4faae8787f6cc76de7ff4b6d08d25d0cb47324ea
parent 1d2b29a9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -43,10 +43,11 @@ __BEGIN_DECLS
/*
 * Use __VA_ARGS__ if running a static analyzer,
 * to avoid warnings of unused variables in __VA_ARGS__.
 * __FAKE_USE_VA_ARGS is undefined at link time,
 * so don't link with __clang_analyzer__ defined.
 */

#ifdef __clang_analyzer__
#define __FAKE_USE_VA_ARGS(...) ((void)(__VA_ARGS__))
extern void __FAKE_USE_VA_ARGS(...);
#else
#define __FAKE_USE_VA_ARGS(...) ((void)(0))
#endif