diff --git a/config/common.mk b/config/common.mk index ebe9bcfb..9e8a0af3 100644 --- a/config/common.mk +++ b/config/common.mk @@ -17,8 +17,10 @@ endif export ATMOSPHERE_DEFINES := -DATMOSPHERE export ATMOSPHERE_SETTINGS := -fPIE -g -export ATMOSPHERE_CFLAGS := -Wall -ffunction-sections -fdata-sections -fno-strict-aliasing -fwrapv \ - -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector +export ATMOSPHERE_CFLAGS := -Wall -ffunction-sections -fdata-sections -fno-strict-aliasing -fwrapv \ + -fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector \ + -Wno-format-truncation + export ATMOSPHERE_CXXFLAGS := -fno-rtti -fno-exceptions -std=gnu++20 export ATMOSPHERE_ASFLAGS := diff --git a/libstratosphere/source/ams/ams_emummc_api.cpp b/libstratosphere/source/ams/ams_emummc_api.cpp index f1c1c888..585cac26 100644 --- a/libstratosphere/source/ams/ams_emummc_api.cpp +++ b/libstratosphere/source/ams/ams_emummc_api.cpp @@ -86,22 +86,17 @@ namespace ams::emummc { const Storage storage = static_cast(g_exo_config.base_cfg.type); g_is_emummc = g_exo_config.base_cfg.magic == StorageMagic && storage != Storage_Emmc; - /* Format paths. Ignore string format warnings. */ - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wformat-truncation" - { - if (storage == Storage_SdFile) { - std::snprintf(g_exo_config.file_cfg.path, sizeof(g_exo_config.file_cfg.path), "/%s", paths->file_path); - } - - std::snprintf(g_exo_config.emu_dir_path, sizeof(g_exo_config.emu_dir_path), "/%s", paths->nintendo_path); - - /* If we're emummc, implement default nintendo redirection path. */ - if (g_is_emummc && std::strcmp(g_exo_config.emu_dir_path, "/") == 0) { - std::snprintf(g_exo_config.emu_dir_path, sizeof(g_exo_config.emu_dir_path), "/emummc/Nintendo_%04x", g_exo_config.base_cfg.id); - } + /* Format paths. */ + if (storage == Storage_SdFile) { + std::snprintf(g_exo_config.file_cfg.path, sizeof(g_exo_config.file_cfg.path), "/%s", paths->file_path); + } + + std::snprintf(g_exo_config.emu_dir_path, sizeof(g_exo_config.emu_dir_path), "/%s", paths->nintendo_path); + + /* If we're emummc, implement default nintendo redirection path. */ + if (g_is_emummc && std::strcmp(g_exo_config.emu_dir_path, "/") == 0) { + std::snprintf(g_exo_config.emu_dir_path, sizeof(g_exo_config.emu_dir_path), "/emummc/Nintendo_%04x", g_exo_config.base_cfg.id); } - #pragma GCC diagnostic pop } g_has_cached = true; diff --git a/libstratosphere/source/patcher/patcher_api.cpp b/libstratosphere/source/patcher/patcher_api.cpp index c7ec0ab9..d13fabba 100644 --- a/libstratosphere/source/patcher/patcher_api.cpp +++ b/libstratosphere/source/patcher/patcher_api.cpp @@ -237,10 +237,7 @@ namespace ams::patcher { } /* Print the path for this directory. */ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wformat-truncation" std::snprintf(path + patches_dir_path_len, sizeof(path) - patches_dir_path_len, "/%s", entry.name); -#pragma GCC diagnostic pop const size_t patch_dir_path_len = patches_dir_path_len + 1 + std::strlen(entry.name); /* Open the patch directory. */