libstdc++: Avoid warning in std::format

With -Wmaybe-uninitialized -Wsystem-headers there's a warning about
creating a string_view from an uninitalized array. Initializing the
first element of the array avoids the warning.

libstdc++-v3/ChangeLog:

	* include/std/format (__write_padded): Initialize first element
	of array to avoid a -Wmaybe-uninitialized warning.
This commit is contained in:
Jonathan Wakely 2023-07-18 22:14:32 +01:00
parent f4bce119f6
commit 2af0f4c346

View file

@ -610,6 +610,7 @@ namespace __format
{
const size_t __buflen = 0x20;
_CharT __padding_chars[__buflen];
__padding_chars[0] = _CharT();
basic_string_view<_CharT> __padding{__padding_chars, __buflen};
auto __pad = [&__padding] (size_t __n, _Out& __o) {