Skip to content

Commit 1fc5512

Browse files
committed
Fixed -Wmaybe-uninitialized warnings
These warnings are only triggered when a combination of `-Wmaybe-uninitialized` and `-ftrivial-auto-var-init=zero` is used with GCC 14.2 or later.
1 parent e99590f commit 1fc5512

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Version 358:
77
* Removed moved sections from documentation
88
* Removed superfluous log messages from tests
99
* Fixed portability issues for building tests in MinGW
10-
* Fixed portability issues for building tests in MinGW
1110
* Fixed `std::is_trivial` deprecation warnings
11+
* Fixed `-Wmaybe-uninitialized` warnings
1212

1313
--------------------------------------------------------------------------------
1414

doc/qbk/release_notes.qbk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* [issue 2999] Used `handshake_timeout` for closing handshake during read operations
2020
* [issue 3003] Added missing `cstdint` header to `detail/cpu_info.hpp`
2121
* [issue 3016] Fixed `std::is_trivial` deprecation warnings
22+
* [issue 3019] Fixed `-Wmaybe-uninitialized` warnings
2223

2324
[*Improvements]
2425

include/boost/beast/websocket/impl/stream_impl.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,7 @@ parse_fh(
825825
{
826826
case 126:
827827
{
828-
829-
std::uint16_t len_be;
828+
std::uint16_t len_be = {};
830829
BOOST_ASSERT(buffer_bytes(cb) >= sizeof(len_be));
831830
cb.consume(net::buffer_copy(
832831
net::mutable_buffer(&len_be, sizeof(len_be)), cb));
@@ -841,7 +840,7 @@ parse_fh(
841840
}
842841
case 127:
843842
{
844-
std::uint64_t len_be;
843+
std::uint64_t len_be = {};
845844
BOOST_ASSERT(buffer_bytes(cb) >= sizeof(len_be));
846845
cb.consume(net::buffer_copy(
847846
net::mutable_buffer(&len_be, sizeof(len_be)), cb));
@@ -857,7 +856,7 @@ parse_fh(
857856
}
858857
if(fh.mask)
859858
{
860-
std::uint32_t key_le;
859+
std::uint32_t key_le = {};
861860
BOOST_ASSERT(buffer_bytes(cb) >= sizeof(key_le));
862861
cb.consume(net::buffer_copy(
863862
net::mutable_buffer(&key_le, sizeof(key_le)), cb));

0 commit comments

Comments
 (0)