clang-cl: fix a bunch of warnings
Some checks failed
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Mac Intel (push) Waiting to run
Build RPCS3 / RPCS3 Mac Apple Silicon (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Build RPCS3 / RPCS3 Windows Clang (push) Waiting to run
Generate Translation Template / Generate Translation Template (push) Failing after 47s
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Has been skipped
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Has been skipped
Build RPCS3 / RPCS3 FreeBSD (push) Has been skipped

This commit is contained in:
Megamouse 2025-07-01 20:54:35 +02:00
parent a5c4951914
commit 2bb2c748bd
8 changed files with 43 additions and 19 deletions

View file

@ -393,7 +393,7 @@ namespace fmt
raw_throw_exception(src_loc, reinterpret_cast<const char*>(fmt), type_info_v<Args...>, fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...}); raw_throw_exception(src_loc, reinterpret_cast<const char*>(fmt), type_info_v<Args...>, fmt_args_t<Args...>{fmt_unveil<Args>::get(args)...});
} }
#ifndef _MSC_VER #if !defined(_MSC_VER) || defined(__clang__)
[[noreturn]] ~throw_exception(); [[noreturn]] ~throw_exception();
#endif #endif
}; };

View file

@ -374,13 +374,23 @@ private:
static const u64 process_affinity_mask; static const u64 process_affinity_mask;
}; };
#if defined(__has_cpp_attribute)
#if __has_cpp_attribute(no_unique_address)
#define NO_UNIQUE_ADDRESS [[no_unique_address]]
#else
#define NO_UNIQUE_ADDRESS
#endif
#else
#define NO_UNIQUE_ADDRESS
#endif
// Used internally // Used internally
template <bool Discard, typename Ctx, typename... Args> template <bool Discard, typename Ctx, typename... Args>
class thread_future_t : public thread_future, result_storage<Ctx, std::conditional_t<Discard, int, void>, Args...> class thread_future_t : public thread_future, result_storage<Ctx, std::conditional_t<Discard, int, void>, Args...>
{ {
[[no_unique_address]] decltype(std::make_tuple(std::forward<Args>(std::declval<Args>())...)) m_args; NO_UNIQUE_ADDRESS decltype(std::make_tuple(std::forward<Args>(std::declval<Args>())...)) m_args;
[[no_unique_address]] Ctx m_func; NO_UNIQUE_ADDRESS Ctx m_func;
using future = thread_future_t; using future = thread_future_t;

View file

@ -23,8 +23,8 @@
#include <iphlpapi.h> #include <iphlpapi.h>
#else #else
#ifdef __clang__ #ifdef __clang__
#pragma GCC diagnostic push #pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast" #pragma clang diagnostic ignored "-Wold-style-cast"
#endif #endif
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
@ -34,7 +34,7 @@
#include <netdb.h> #include <netdb.h>
#include <unistd.h> #include <unistd.h>
#ifdef __clang__ #ifdef __clang__
#pragma GCC diagnostic pop #pragma clang diagnostic pop
#endif #endif
#endif #endif

View file

@ -23,8 +23,8 @@
#include <WS2tcpip.h> #include <WS2tcpip.h>
#else #else
#ifdef __clang__ #ifdef __clang__
#pragma GCC diagnostic push #pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast" #pragma clang diagnostic ignored "-Wold-style-cast"
#endif #endif
#include <sys/time.h> #include <sys/time.h>
#include <sys/types.h> #include <sys/types.h>
@ -37,7 +37,7 @@
#include <poll.h> #include <poll.h>
#include <netdb.h> #include <netdb.h>
#ifdef __clang__ #ifdef __clang__
#pragma GCC diagnostic pop #pragma clang diagnostic pop
#endif #endif
#endif #endif

View file

@ -12,14 +12,14 @@
#include <ws2tcpip.h> #include <ws2tcpip.h>
#else #else
#ifdef __clang__ #ifdef __clang__
#pragma GCC diagnostic push #pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast" #pragma clang diagnostic ignored "-Wold-style-cast"
#endif #endif
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#ifdef __clang__ #ifdef __clang__
#pragma GCC diagnostic pop #pragma clang diagnostic pop
#endif #endif
#endif #endif
@ -29,13 +29,13 @@
#include <flatbuffers/flatbuffers.h> #include <flatbuffers/flatbuffers.h>
#ifdef __clang__ #ifdef __clang__
#pragma GCC diagnostic push #pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast" #pragma clang diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wextern-c-compat" #pragma clang diagnostic ignored "-Wextern-c-compat"
#endif #endif
#include <wolfssl/ssl.h> #include <wolfssl/ssl.h>
#ifdef __clang__ #ifdef __clang__
#pragma GCC diagnostic pop #pragma clang diagnostic pop
#endif #endif
#include "rpcn_types.h" #include "rpcn_types.h"

View file

@ -36,7 +36,7 @@ private:
#define VMA_RW_MUTEX VmaRWMutex #define VMA_RW_MUTEX VmaRWMutex
#define VMA_MUTEX VmaRWMutex #define VMA_MUTEX VmaRWMutex
#ifdef _MSC_VER #if defined(_MSC_VER) && !defined(__clang__)
#pragma warning(push, 0) #pragma warning(push, 0)
#else #else
#pragma GCC diagnostic push #pragma GCC diagnostic push

View file

@ -16,8 +16,17 @@
#include "Emu/NP/rpcn_config.h" #include "Emu/NP/rpcn_config.h"
#include "Emu/NP/ip_address.h" #include "Emu/NP/ip_address.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wold-style-cast"
#pragma clang diagnostic ignored "-Wextern-c-compat"
#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
#endif
#include <wolfssl/ssl.h> #include <wolfssl/ssl.h>
#include <wolfssl/openssl/evp.h> #include <wolfssl/openssl/evp.h>
#ifdef __clang__
#pragma clang diagnostic pop
#endif
LOG_CHANNEL(rpcn_settings_log, "rpcn settings dlg"); LOG_CHANNEL(rpcn_settings_log, "rpcn settings dlg");

View file

@ -207,7 +207,10 @@ namespace stx
} }
}; };
#ifndef _MSC_VER #ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#elif !defined(_MSC_VER)
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winvalid-offsetof" #pragma GCC diagnostic ignored "-Winvalid-offsetof"
#endif #endif
@ -316,7 +319,9 @@ namespace stx
return make_single<std::remove_reference_t<T>>(std::forward<T>(value)); return make_single<std::remove_reference_t<T>>(std::forward<T>(value));
} }
#ifndef _MSC_VER #ifdef __clang__
#pragma clang diagnostic pop
#elif !defined(_MSC_VER)
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif