Merge pull request #5819 from cjacek/clang-warnings

Fix warnings in llvm-mingw builds
This commit is contained in:
Ryan Houdek authored and GitHub committed 2026-08-10 10:37:40 -07:00
commit f6d20a1a88
11 files changed
+28 -29

No files matched your search

+2 -2
View File
@@ -9,8 +9,8 @@ set(CMAKE_AR ${MINGW_TRIPLE}-ar)
# Compile everything as static to avoid requiring the MinGW runtime libraries, force page aligned sections so that
# debug symbols work correctly, and disable loop alignment to workaround an LLVM bug
# (https://github.com/llvm/llvm-project/issues/47432)
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-static -static-libgcc -static-libstdc++ -Wl,--file-alignment=4096,/mllvm:-align-loops=1")
set(CMAKE_EXE_LINKER_FLAGS_INIT "-static -static-libgcc -static-libstdc++ -Wl,--file-alignment=4096,/mllvm:-align-loops=1")
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-static -Wl,--file-alignment=4096,/mllvm:-align-loops=1")
set(CMAKE_EXE_LINKER_FLAGS_INIT "-static -Wl,--file-alignment=4096,/mllvm:-align-loops=1")
set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
set(CMAKE_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)
@@ -10,11 +10,6 @@
namespace FEXCore::CPU {
template<typename R, typename... Args>
static FallbackInfo GetFallbackInfo(R (*fn)(Args...), FEXCore::Core::FallbackHandlerIndex HandlerIndex) {
return {FABI_UNKNOWN, HandlerIndex};
}
void InterpreterOps::FillFallbackIndexPointers(Core::FallbackABIInfo* Info, uint64_t* ABIHandlers) {
Info[Core::OPINDEX_F80CVTTO_4] = {ABIHandlers[FABI_F80_I16_F32_PTR],
reinterpret_cast<uint64_t>(&FEXCore::CPU::OpHandlers<IR::OP_F80CVTTO>::handle4)};
@@ -216,12 +211,6 @@ bool InterpreterOps::GetFallbackHandler(const IR::IROp_Header* IROp, FallbackInf
return true; \
}
#define COMMON_F64_OP(OP) \
case IR::OP_F64##OP: { \
*Info = GetFallbackInfo(&FEXCore::CPU::OpHandlers<IR::OP_F64##OP>::handle, Core::OPINDEX_F64##OP); \
return true; \
}
#define COMMON_UNARY_F64_OP(OP) \
case IR::OP_F64##OP: { \
*Info = {FABI_F64_F64_PTR, Core::OPINDEX_F64##OP}; \
+3
View File
@@ -6,6 +6,9 @@
namespace FEXCore::UncheckedLongJump {
#if defined(ARCHITECTURE_arm64)
#ifdef __arm64ec__
#pragma clang diagnostic ignored "-Winline-asm"
#endif
[[nodiscard]]
FEX_DEFAULT_VISIBILITY FEX_NAKED uint64_t SetJump(JumpBuf& Buffer) {
__asm volatile(R"(
@@ -250,19 +250,19 @@ public:
template<template<typename> class LockType = std::unique_lock, typename MutexType>
[[nodiscard]]
static auto MaskSignalsAndLockMutex(MutexType& mutex, uint64_t Mask = ~0ULL) {
static inline auto MaskSignalsAndLockMutex(MutexType& mutex, uint64_t Mask = ~0ULL) {
return LockType<MutexType> {mutex};
}
template<template<typename> class LockType = std::unique_lock, typename MutexType>
[[nodiscard]]
static auto GuardSignalDeferringSection(MutexType& mutex, FEXCore::Core::InternalThreadState* Thread, uint64_t Mask = ~0ULL) {
static inline auto GuardSignalDeferringSection(MutexType& mutex, FEXCore::Core::InternalThreadState* Thread, uint64_t Mask = ~0ULL) {
return LockType<MutexType> {mutex};
}
template<template<typename> class LockType = std::unique_lock, typename MutexType>
[[nodiscard]]
static auto GuardSignalDeferringSectionWithFallback(MutexType& mutex, FEXCore::Core::InternalThreadState* Thread, uint64_t Mask = ~0ULL) {
static inline auto GuardSignalDeferringSectionWithFallback(MutexType& mutex, FEXCore::Core::InternalThreadState* Thread, uint64_t Mask = ~0ULL) {
return LockType<MutexType> {mutex};
}
+2
View File
@@ -72,7 +72,9 @@ GetSysReg(MIDR_EL1, MIDR_EL1);
GetSysReg(ISAR1_EL1, ID_AA64ISAR1_EL1);
GetSysReg(MMFR0_EL1, ID_AA64MMFR0_EL1);
GetSysReg(MMFR2_EL1, ID_AA64MMFR2_EL1);
#ifndef _WIN32
GetSysReg(MMFR3_EL1, s3_0_c0_c7_3); // Can't request by name
#endif
GetSysReg(ZFR0_EL1, s3_0_c0_c4_4); // Can't request by name
GetSysReg(MMFR1_EL1, ID_AA64MMFR1_EL1);
GetSysReg(ISAR2_EL1, ID_AA64ISAR2_EL1);
+2
View File
@@ -136,6 +136,7 @@ public:
#endif
};
#ifndef _WIN32
static void MsgHandler(LogMan::DebugLevels Level, const char* Message) {
fmt::print("[{}] {}\n", LogMan::DebugLevelStr(Level), Message);
}
@@ -143,6 +144,7 @@ static void MsgHandler(LogMan::DebugLevels Level, const char* Message) {
static void AssertHandler(const char* Message) {
fmt::print("[A] {}\n", Message);
}
#endif
namespace FEXCore {
inline bool operator<(const ExecutableFileInfo& a, const ExecutableFileInfo& b) noexcept {
+1 -1
View File
@@ -51,7 +51,7 @@ void InitEnv() {
__attribute__((used, section(".CRT$FEXB"))) void (*_InitEnv)(void) = InitEnv;
} // namespace
char*** __p__environ() {
DLLEXPORT_FUNC(char***, __p__environ, ()) {
return &EnvArray;
}
+3
View File
@@ -153,6 +153,7 @@ static inline long double fp_barrierl(long double x) {
static inline void fp_force_evalf(float x) {
volatile float y;
y = x;
(void)y;
}
#endif
@@ -161,6 +162,7 @@ static inline void fp_force_evalf(float x) {
static inline void fp_force_eval(double x) {
volatile double y;
y = x;
(void)y;
}
#endif
@@ -169,6 +171,7 @@ static inline void fp_force_eval(double x) {
static inline void fp_force_evall(long double x) {
volatile long double y;
y = x;
(void)y;
}
#endif
+1 -2
View File
@@ -6,8 +6,7 @@
#include <errno.h>
#include <ctype.h>
intmax_t strtoimax(const char* s1, char** p, int base) {
const unsigned char* s = s1;
intmax_t strtoimax(const char* s, char** p, int base) {
int sign = 0;
uintmax_t x;
+1 -1
View File
@@ -21,7 +21,7 @@ static const unsigned char digits[] = {
};
uintmax_t strtoumax(const char* s1, char** p, int base) {
const unsigned char* s = s1;
const unsigned char* s = (const unsigned char*)s1;
size_t x1, z1;
uintmax_t x, z = 0;
int sign = 0;
+10 -9
View File
@@ -120,11 +120,11 @@ int snprintf(char* stream, size_t n, const char* format, ...) {
return ret;
}
char* setlocale(int _Category, const char* _Locale) {
DLLEXPORT_FUNC(char*, setlocale, (int _Category, const char* _Locale)) {
return Locale;
}
int _configthreadlocale(int _Flag) {
DLLEXPORT_FUNC(int, _configthreadlocale, (int _Flag)) {
return 0;
}
@@ -138,16 +138,17 @@ DLLEXPORT_FUNC(struct lconv*, localeconv, (void)) {
DLLEXPORT_FUNC(void, _free_locale, (_locale_t _Locale)) {}
wint_t btowc(int) {
DLLEXPORT_FUNC(wint_t, btowc, (int)) {
UNIMPLEMENTED();
}
size_t mbsrtowcs(wchar_t* __restrict__ _Dest, const char** __restrict__ _PSrc, size_t _Count,
mbstate_t* __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN {
DLLEXPORT_FUNC(size_t, mbsrtowcs, (wchar_t* __restrict__ _Dest, const char** __restrict__ _PSrc, size_t _Count, mbstate_t* __restrict__ _State))
__MINGW_ATTRIB_DEPRECATED_SEC_WARN {
UNIMPLEMENTED();
}
size_t mbrtowc(wchar_t* __restrict__ _DstCh, const char* __restrict__ _SrcCh, size_t _SizeInBytes, mbstate_t* __restrict__ _State) {
DLLEXPORT_FUNC(size_t, mbrtowc,
(wchar_t* __restrict__ _DstCh, const char* __restrict__ _SrcCh, size_t _SizeInBytes, mbstate_t* __restrict__ _State)) {
UNIMPLEMENTED();
}
@@ -159,11 +160,11 @@ DLLEXPORT_FUNC(int, _mbtowc_l, (wchar_t* __restrict__ DstCh, const char* __restr
return 1;
}
size_t mbrlen(const char* __restrict__ _Ch, size_t _SizeInBytes, mbstate_t* __restrict__ _State) {
DLLEXPORT_FUNC(size_t, mbrlen, (const char* __restrict__ _Ch, size_t _SizeInBytes, mbstate_t* __restrict__ _State)) {
UNIMPLEMENTED();
}
size_t wcrtomb(char* __restrict__ _Dest, wchar_t _Source, mbstate_t* __restrict__ _State) {
DLLEXPORT_FUNC(size_t, wcrtomb, (char* __restrict__ _Dest, wchar_t _Source, mbstate_t* __restrict__ _State)) {
UNIMPLEMENTED();
}
@@ -171,7 +172,7 @@ DLLEXPORT_FUNC(errno_t, wcrtomb_s, (size_t* _Retval, char* _Dst, size_t _SizeInB
UNIMPLEMENTED();
}
int wctob(wint_t _WCh) {
DLLEXPORT_FUNC(int, wctob, (wint_t _WCh)) {
UNIMPLEMENTED();
}