summaryrefslogtreecommitdiff
path: root/libcutils/socket_local_server_unix.cpp
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2017-05-02 22:06:39 -0700
committerGeorge Burgess IV <gbiv@google.com>2017-05-03 17:16:01 -0700
commit582ec2b0788443fd4aebda0b6d26228d2a4070b3 (patch)
tree06792ab8e36028ae3fd6ae3f48e0f85194765e2c /libcutils/socket_local_server_unix.cpp
parent8fc6cc8910dbb4c77333aa432b4732237157ed0b (diff)
fix static-analyzer logging/CHECK macros
Two small changes in one: - `foo || for (;;abort()) bar();` isn't valid C or C++, since for is a statement. We need an expression instead. - we'll now treat everything after LOG(foo) as unreachable in the static analyzer, as long as we can prove at compile-time that foo == FATAL. The impact of this, running across internal master, is that we see ~50 fewer medium/high-severity false positives from clang-tidy. We see 15 new complaints about unreachable code (at the "tidy" severity), but all of them are harmless AFAICT (e.g. switch (foo) { // ... default: LOG(FATAL) << "Unhandled case!"; // or CHECK(false); break; // clang-tidy: unreachable break. }) (Some of the macros were forcibly formatted by the clang-format hook) Bug: None Test: Ran `DEFAULT_GLOBAL_TIDY_CHECKS=clang-analyzer*,-clang-analyzer-alpha* m`; stared at warn.py output. Change-Id: Ie984eda0481afad4274b9def7c61ba777cfa289a
Diffstat (limited to 'libcutils/socket_local_server_unix.cpp')
0 files changed, 0 insertions, 0 deletions