From 187745abd510714dd1c1c0f707e4906d5de6a7ba Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sat, 7 May 2022 17:09:22 -0700 Subject: [PATCH] ams: address some warnings when building with gcc-12 --- .../stratosphere/ncm/ncm_content_meta_extended_data.hpp | 2 +- libraries/libstratosphere/libstratosphere.mk | 2 ++ .../include/vapours/crypto/crypto_sha256_generator.hpp | 4 ++-- .../libvapours/source/crypto/crypto_sha256_generator.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_extended_data.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_extended_data.hpp index f30de09de..dc693875a 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_extended_data.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_extended_data.hpp @@ -843,7 +843,7 @@ namespace ams::ncm { R_SUCCEED_IF(m_header.has_value()); /* Get our header. */ - PatchMetaExtendedDataHeader header; + PatchMetaExtendedDataHeader header{}; R_TRY(this->GetHeader(std::addressof(header))); /* Set our header. */ diff --git a/libraries/libstratosphere/libstratosphere.mk b/libraries/libstratosphere/libstratosphere.mk index e646ea02f..7ed6a8a90 100644 --- a/libraries/libstratosphere/libstratosphere.mk +++ b/libraries/libstratosphere/libstratosphere.mk @@ -148,6 +148,8 @@ init_libnx_shim.os.horizon.o: CXXFLAGS += -fno-lto result_get_name.o: CXXFLAGS += -fno-lto +crypto_sha256_generator.o: CXXFLAGS += -fno-lto + spl_secure_monitor_api.os.generic.o: CXXFLAGS += -I$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/include fs_id_string_impl.os.generic.o: CXXFLAGS += -I$(ATMOSPHERE_LIBRARIES_DIR)/libexosphere/include diff --git a/libraries/libvapours/include/vapours/crypto/crypto_sha256_generator.hpp b/libraries/libvapours/include/vapours/crypto/crypto_sha256_generator.hpp index fe658bfcc..9ea6466b4 100644 --- a/libraries/libvapours/include/vapours/crypto/crypto_sha256_generator.hpp +++ b/libraries/libvapours/include/vapours/crypto/crypto_sha256_generator.hpp @@ -47,9 +47,9 @@ namespace ams::crypto { }; static constexpr size_t Asn1IdentifierSize = util::size(Asn1Identifier); private: - Impl m_impl; + Impl m_impl{}; public: - Sha256Generator() { /* ... */ } + Sha256Generator() = default; void Initialize() { m_impl.Initialize(); diff --git a/libraries/libvapours/source/crypto/crypto_sha256_generator.cpp b/libraries/libvapours/source/crypto/crypto_sha256_generator.cpp index 2d2488e06..15c520478 100644 --- a/libraries/libvapours/source/crypto/crypto_sha256_generator.cpp +++ b/libraries/libvapours/source/crypto/crypto_sha256_generator.cpp @@ -18,7 +18,7 @@ namespace ams::crypto { void GenerateSha256(void *dst, size_t dst_size, const void *src, size_t src_size) { - Sha256Generator gen; + Sha256Generator gen{}; gen.Initialize(); gen.Update(src, src_size);