GCC cannot infer that `LogMessage::Finish()` (called indirectly by `GOOGLE_LOG(FAIL)` in `AlignFail`) exits program when `level_ == LOGLEVEL_FATAL`. Compilation will create a warning in projects importing the library for debug builds. The attribute cannot be individually assigned to `LogMessage::Finish()` because it does return conditionally of the log level. Tried with GCC 9.3.0 and GCC 12.1.0. This change adds an explicit abort() for compiler to clearly understand this does not return, and enables `[[noreturn]]` for MSVC as well.pull/10188/head
parent
7489aef20f
commit
1e9d43fe71
1 changed files with 4 additions and 3 deletions
Loading…
Reference in new issue