diff options
author | Chih-Hung Hsieh <chh@google.com> | 2018-07-23 13:03:19 -0700 |
---|---|---|
committer | Chih-Hung Hsieh <chh@google.com> | 2018-07-23 13:03:19 -0700 |
commit | 67f72bde26e8e97227f72c7ff0b0d8b3bef62f0e (patch) | |
tree | 712ad476f274cdcb43b3520cdc03b7b4d37525dc /liblog | |
parent | 1d2b29a9022ae9910bda2e1371066179bbd176d6 (diff) | |
download | system_core-67f72bde26e8e97227f72c7ff0b0d8b3bef62f0e.tar.gz system_core-67f72bde26e8e97227f72c7ff0b0d8b3bef62f0e.tar.bz2 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
Diffstat (limited to 'liblog')
-rw-r--r-- | liblog/include/log/log_main.h | 5 |
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 /* * 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 |