Commit 609770ce by Andy Getzendanner Committed by Copybara-Service

Work around GCC -Wuninitialized when initializing a span from an uninitialized array in logging.

It's uninitialized on purpose; we'll write into it through the span.

PiperOrigin-RevId: 504318917
Change-Id: I79835f0190253b8b470b3ca404f3979715f2a718
parent 20f44782
...@@ -163,7 +163,8 @@ LogMessage::LogMessageData::LogMessageData(const char* file, int line, ...@@ -163,7 +163,8 @@ LogMessage::LogMessageData::LogMessageData(const char* file, int line,
absl::Time timestamp) absl::Time timestamp)
: extra_sinks_only(false), : extra_sinks_only(false),
manipulated(nullptr), manipulated(nullptr),
encoded_remaining(encoded_buf) { // This `absl::MakeSpan` silences spurious -Wuninitialized from GCC:
encoded_remaining(absl::MakeSpan(encoded_buf)) {
// Legacy defaults for LOG's ostream: // Legacy defaults for LOG's ostream:
manipulated.setf(std::ios_base::showbase | std::ios_base::boolalpha); manipulated.setf(std::ios_base::showbase | std::ios_base::boolalpha);
entry.full_filename_ = file; entry.full_filename_ = file;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment