Skip to content

Commit df25742

Browse files
fix C++20 warnings
Address some C++ 20 compiler warnings to fix the mingw build job, which has been [failing nightly in CI](https://github.com/compnerd/ds2/actions/runs/16134337356). Co-authored-by: Saleem Abdulrasool <[email protected]>
1 parent f488656 commit df25742

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Headers/DebugServer2/Base.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
typedef SSIZE_T ssize_t;
2020
#endif
2121
#else
22+
#include <cstdint>
2223
#include <cstdlib>
2324
#endif
2425
#include <iostream>
@@ -117,7 +118,7 @@ typedef SSIZE_T ssize_t;
117118
// structure, and not held as a reference or a pointer.
118119
template <typename T>
119120
typename std::enable_if<
120-
!std::is_pointer<T>::value && std::is_pod<T>::value,
121+
!std::is_pointer_v<T> && std::is_standard_layout_v<T>,
121122
size_t>::type static inline constexpr array_sizeof(T const &array) {
122123
return sizeof(array) / (reinterpret_cast<uintptr_t>(&array[1]) -
123124
reinterpret_cast<uintptr_t>(&array[0]));

Headers/DebugServer2/Core/CPUTypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ enum CPUSubType {
258258
};
259259

260260
static inline bool CPUTypeIs64Bit(CPUType type) {
261-
return type & kCPUArchABI64 || type == kCPUTypeALPHA ||
262-
type == kCPUTypeRISCV64;
261+
return static_cast<int>(type) & static_cast<int>(kCPUArchABI64) ||
262+
type == kCPUTypeALPHA || type == kCPUTypeRISCV64;
263263
}
264264

265265
char const *GetCPUTypeName(CPUType type);

0 commit comments

Comments
 (0)