platform_system_core/base/include/android-base
George Burgess IV 582ec2b078 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
2017-05-03 17:16:01 -07:00
..
chrono_utils.h Revert "base: make boot_clock work on host linux, hide it on non-linux." 2017-05-01 21:56:28 +00:00
endian.h Add cross-platform <android-base/endian.h>. 2017-02-24 14:03:36 -08:00
errors.h Fix <android-base/*.h> header guards. 2016-03-23 15:04:52 -07:00
file.h Add android::base::Realpath. 2017-03-15 22:20:50 -07:00
logging.h fix static-analyzer logging/CHECK macros 2017-05-03 17:16:01 -07:00
macros.h Base: assume and use C++11 in libbase 2016-09-01 13:38:12 -07:00
memory.h Switch to memcpy for accessing misaligned data. 2016-12-07 03:46:55 -08:00
parsedouble.h libbase: add parsedouble.h. 2016-10-19 11:19:42 -07:00
parseint.h Move off std::sto* function which abort on failure. 2016-10-13 15:34:05 -07:00
parsenetaddress.h Fix <android-base/*.h> header guards. 2016-03-23 15:04:52 -07:00
properties.h Fix timeouts for android::base::WaitForProperty* 2017-03-27 18:05:58 -07:00
quick_exit.h base: add quick_exit emulation. 2016-09-13 17:54:50 -07:00
scopeguard.h Add android::base::ScopeGuard 2017-04-05 16:15:33 -07:00
stringprintf.h Fix <android-base/*.h> header guards. 2016-03-23 15:04:52 -07:00
strings.h bootable/recovery wants EqualsIgnoreCase. 2017-01-13 18:51:32 -08:00
test_utils.h Move CapturedStderr to test_util library 2016-10-22 10:35:21 -07:00
thread_annotations.h Base: add more thread annotations 2016-08-31 13:29:07 -07:00
unique_fd.h base: rename unique_fd::clear() to unique_fd::reset(). 2016-09-19 11:24:58 -07:00
utf8.h Fix <android-base/*.h> header guards. 2016-03-23 15:04:52 -07:00