diff --git a/CHANGELOG.md b/CHANGELOG.md index 75709c54..3c1502fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ Version 66: * string_param optimizations * Add serializer request/response aliases * Make consuming_buffers smaller +* Fix costly potential value-init in parser +* Fix unused parameter warning -------------------------------------------------------------------------------- diff --git a/include/beast/core/detail/static_string.hpp b/include/beast/core/detail/static_string.hpp index 2f8a5810..03468e01 100644 --- a/include/beast/core/detail/static_string.hpp +++ b/include/beast/core/detail/static_string.hpp @@ -119,6 +119,7 @@ template< CharT* raw_to_string(CharT* last, std::size_t size, Integer i) { + boost::ignore_unused(size); BOOST_ASSERT(size >= max_digits(sizeof(Integer))); return raw_to_string( last, i, std::is_signed{}); diff --git a/include/beast/http/parser.hpp b/include/beast/http/parser.hpp index f6182990..e6b9481d 100644 --- a/include/beast/http/parser.hpp +++ b/include/beast/http/parser.hpp @@ -67,7 +67,12 @@ public: message>; /// Constructor (default) - parser() = default; + parser() + { + // avoid `parser()=default` otherwise value-init + // for members can happen (i.e. a big memset on + // static_buffer_n). + } /// Copy constructor (disallowed) parser(parser const&) = delete;