summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hung Hsieh2018-07-23 15:03:19 -0500
committerChih-Hung Hsieh2018-07-23 15:03:19 -0500
commit67f72bde26e8e97227f72c7ff0b0d8b3bef62f0e (patch)
tree712ad476f274cdcb43b3520cdc03b7b4d37525dc
parent1d2b29a9022ae9910bda2e1371066179bbd176d6 (diff)
downloadplatform-system-core-67f72bde26e8e97227f72c7ff0b0d8b3bef62f0e.tar.gz
platform-system-core-67f72bde26e8e97227f72c7ff0b0d8b3bef62f0e.tar.xz
platform-system-core-67f72bde26e8e97227f72c7ff0b0d8b3bef62f0e.zip
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
-rw-r--r--liblog/include/log/log_main.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/liblog/include/log/log_main.h b/liblog/include/log/log_main.h
index f1ff31aa0..9c68ff2b4 100644
--- a/liblog/include/log/log_main.h
+++ b/liblog/include/log/log_main.h
@@ -43,10 +43,11 @@ __BEGIN_DECLS
43/* 43/*
44 * Use __VA_ARGS__ if running a static analyzer, 44 * Use __VA_ARGS__ if running a static analyzer,
45 * to avoid warnings of unused variables in __VA_ARGS__. 45 * to avoid warnings of unused variables in __VA_ARGS__.
46 * __FAKE_USE_VA_ARGS is undefined at link time,
47 * so don't link with __clang_analyzer__ defined.
46 */ 48 */
47
48#ifdef __clang_analyzer__ 49#ifdef __clang_analyzer__
49#define __FAKE_USE_VA_ARGS(...) ((void)(__VA_ARGS__)) 50extern void __FAKE_USE_VA_ARGS(...);
50#else 51#else
51#define __FAKE_USE_VA_ARGS(...) ((void)(0)) 52#define __FAKE_USE_VA_ARGS(...) ((void)(0))
52#endif 53#endif