diff --git a/src/core/devtools/widget/cmd_list.cpp b/src/core/devtools/widget/cmd_list.cpp index dc3eb9cdd..f27122c88 100644 --- a/src/core/devtools/widget/cmd_list.cpp +++ b/src/core/devtools/widget/cmd_list.cpp @@ -293,7 +293,7 @@ void ParseColorControl(u32 value, bool begin_table) { TableSetColumnIndex(0); Text("ROP3"); TableSetColumnIndex(1); - Text("%X", reg.rop3.Value()); + Text("%X", static_cast(reg.rop3.Value())); if (begin_table) { EndTable(); @@ -790,7 +790,7 @@ void ParseZInfo(u32 value, bool begin_table) { TableSetColumnIndex(0); Text("TILE_MODE_INDEX"); TableSetColumnIndex(1); - Text("%X", reg.tile_mode_index.Value()); + Text("%X", static_cast(reg.tile_mode_index.Value())); TableNextRow(); TableSetColumnIndex(0); diff --git a/src/core/devtools/widget/memory_map.cpp b/src/core/devtools/widget/memory_map.cpp index 4cf2743f2..055508ccd 100644 --- a/src/core/devtools/widget/memory_map.cpp +++ b/src/core/devtools/widget/memory_map.cpp @@ -26,7 +26,7 @@ bool MemoryMapViewer::Iterator::DrawLine() { TableNextColumn(); Text("%" PRIXPTR, m.base); TableNextColumn(); - Text("%llX", m.size); + Text("%" PRIX64, m.size); TableNextColumn(); Text("%s", magic_enum::enum_name(m.type).data()); TableNextColumn(); @@ -51,7 +51,7 @@ bool MemoryMapViewer::Iterator::DrawLine() { TableNextColumn(); Text("%" PRIXPTR, m.base); TableNextColumn(); - Text("%llX", m.size); + Text("%" PRIX64, m.size); TableNextColumn(); auto type = static_cast<::Libraries::Kernel::MemoryTypes>(m.memory_type); Text("%s", magic_enum::enum_name(type).data()); diff --git a/src/core/libraries/fiber/fiber_context.s b/src/core/libraries/fiber/fiber_context.s index 04fe93581..4c8f20f71 100644 --- a/src/core/libraries/fiber/fiber_context.s +++ b/src/core/libraries/fiber/fiber_context.s @@ -118,4 +118,4 @@ _sceFiberSwitchEntry: # Fiber returned, not good movl $1, %edi call _sceFiberForceQuit - ret \ No newline at end of file + ret diff --git a/src/core/libraries/kernel/threads/exception.h b/src/core/libraries/kernel/threads/exception.h index 985a7f56b..6a851e9d8 100644 --- a/src/core/libraries/kernel/threads/exception.h +++ b/src/core/libraries/kernel/threads/exception.h @@ -59,7 +59,7 @@ struct Mcontext { u64 mc_spare[6]; }; -struct Stack { +struct ExStack { void* ss_sp; std::size_t ss_size; int ss_flags; @@ -75,7 +75,7 @@ struct Ucontext { int field1_0x10[12]; struct Mcontext uc_mcontext; struct Ucontext* uc_link; - struct Stack uc_stack; + struct ExStack uc_stack; int uc_flags; int __spare[4]; int field7_0x4f4[3]; diff --git a/src/core/libraries/libc_internal/printf.h b/src/core/libraries/libc_internal/printf.h index 9c22e922c..c44110d0f 100644 --- a/src/core/libraries/libc_internal/printf.h +++ b/src/core/libraries/libc_internal/printf.h @@ -60,6 +60,7 @@ #include #include #include +#include #include "common/va_ctx.h" @@ -745,17 +746,17 @@ static int fprintf_ctx(Common::VaCtx* ctx, char* buf) { } static int vsnprintf_ctx(char* s, size_t n, const char* format, Common::VaList* arg) { - char buffer[n]; - int result = _vsnprintf(_out_buffer, buffer, format, arg); - std::strcpy(s, buffer); + std::vector buffer(n); + int result = _vsnprintf(_out_buffer, buffer.data(), format, arg); + std::strcpy(s, buffer.data()); return result; } static int snprintf_ctx(char* s, size_t n, Common::VaCtx* ctx) { const char* format = vaArgPtr(&ctx->va_list); - char buffer[n]; - int result = _vsnprintf(_out_buffer, buffer, format, &ctx->va_list); - std::strcpy(s, buffer); + std::vector buffer(n); + int result = _vsnprintf(_out_buffer, buffer.data(), format, &ctx->va_list); + std::strcpy(s, buffer.data()); return result; } diff --git a/src/core/libraries/network/net.cpp b/src/core/libraries/network/net.cpp index b2b241e5a..fb07782a0 100644 --- a/src/core/libraries/network/net.cpp +++ b/src/core/libraries/network/net.cpp @@ -904,7 +904,7 @@ const char* freebsd_inet_ntop6(const unsigned char* src, char* dst, u64 size) { tp += strlen(tp); break; } - tp += sprintf(tp, "%x", words[i]); + tp += snprintf(tp, sizeof(tmp) - (tp - tmp), "%x", words[i]); } /* Was it a trailing run of 0x00's? */ if (best.base != -1 && (best.base + best.len) == (NS_IN6ADDRSZ / NS_INT16SZ)) diff --git a/src/core/loader/symbols_resolver.h b/src/core/loader/symbols_resolver.h index e2337a567..666dc2332 100644 --- a/src/core/loader/symbols_resolver.h +++ b/src/core/loader/symbols_resolver.h @@ -7,6 +7,7 @@ #include #include #include +#include "common/assert.h" #include "common/types.h" namespace Core::Loader { @@ -66,6 +67,8 @@ public: return "Tls"; case SymbolType::NoType: return "NoType"; + default: + UNREACHABLE(); } } diff --git a/src/core/tls.h b/src/core/tls.h index 470553d85..787744cd3 100644 --- a/src/core/tls.h +++ b/src/core/tls.h @@ -43,7 +43,12 @@ Tcb* GetTcbBase(); void EnsureThreadInitialized(); template -__attribute__((optnone)) void ClearStack() { +#ifdef __clang__ +__attribute__((optnone)) +#else +__attribute__((optimize("O0"))) +#endif +void ClearStack() { volatile void* buf = alloca(size); memset(const_cast(buf), 0, size); buf = nullptr; diff --git a/src/imgui/renderer/imgui_impl_vulkan.cpp b/src/imgui/renderer/imgui_impl_vulkan.cpp index af523089d..97f44c318 100644 --- a/src/imgui/renderer/imgui_impl_vulkan.cpp +++ b/src/imgui/renderer/imgui_impl_vulkan.cpp @@ -471,7 +471,7 @@ void RemoveTexture(ImTextureID texture) { IM_ASSERT(texture != nullptr); VkData* bd = GetBackendData(); const InitInfo& v = bd->init_info; - v.device.freeDescriptorSets(bd->descriptor_pool, {texture->descriptor_set}); + CheckVkErr(v.device.freeDescriptorSets(bd->descriptor_pool, {texture->descriptor_set})); delete texture; } diff --git a/src/shader_recompiler/ir/condition.h b/src/shader_recompiler/ir/condition.h index da986c48d..5ee6d1558 100644 --- a/src/shader_recompiler/ir/condition.h +++ b/src/shader_recompiler/ir/condition.h @@ -37,6 +37,8 @@ constexpr std::string_view NameOf(Condition condition) { return "Execz"; case Condition::Execnz: return "Execnz"; + default: + UNREACHABLE(); } }