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
diff --git a/absl/log/internal/log_message.cc b/absl/log/internal/log_message.cc index a808061..bdb10f2 100644 --- a/absl/log/internal/log_message.cc +++ b/absl/log/internal/log_message.cc
@@ -163,7 +163,8 @@ absl::Time timestamp) : extra_sinks_only(false), 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: manipulated.setf(std::ios_base::showbase | std::ios_base::boolalpha); entry.full_filename_ = file;