From 31ca3c3770b51945e3409d7e75f4ebb2f4789a9c Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Tue, 22 Dec 2015 10:49:02 -0800 Subject: [PATCH] liblog: build break Some compilers erroneously see uninitialized use, even despite all accesses being behind !not_locked. Confirmed initialization does not affect expected performance. Bug: 26178938 Bug: 26029733 Bug: 17760225 Change-Id: Ib36ed8dd2c4b196ca84ef79a9531625dcee77e15 --- liblog/log_is_loggable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/liblog/log_is_loggable.c b/liblog/log_is_loggable.c index c73afcf0e..0f81efc80 100644 --- a/liblog/log_is_loggable.c +++ b/liblog/log_is_loggable.c @@ -112,7 +112,8 @@ static int __android_log_level(const char *tag, int default_prio) */ static char *last_tag; static uint32_t global_serial; - uint32_t current_global_serial; + /* some compilers erroneously see uninitialized use. !not_locked */ + uint32_t current_global_serial = 0; static struct cache tag_cache[2]; static struct cache global_cache[2]; int change_detected;