all: cleanups

This commit is contained in:
Markus F.X.J. Oberhumer
2023-10-21 11:22:18 +02:00
parent 91c15b2475
commit 9fbe95ad48
16 changed files with 220 additions and 119 deletions
+1 -11
View File
@@ -200,7 +200,7 @@ class XSpanInternalDummyArgFake; // not implemented on purpose
typedef XSpanInternalDummyArgFake *XSpanInternalDummyArg;
#define XSpanInternalDummyArgInit nullptr
#elif __cplusplus >= 201103L && 1
// use an enum
// use an enum and a move constructor
struct XSpanInternalDummyArg final {
enum DummyEnum {};
explicit forceinline_constexpr XSpanInternalDummyArg(DummyEnum &&) noexcept {}
@@ -220,16 +220,6 @@ private:
(XSPAN_NS(XSpanInternalDummyArg)(XSPAN_NS(XSpanInternalDummyArg)::make()))
#endif
// poison a pointer: point to a non-null invalid address
// - resulting pointer should crash on dereference
// - this should be efficient (so no mmap() guard page etc.)
// - this should play nice with runtime checkers like ASAN, MSAN, valgrind, etc.
// - this should play nice with static analyzers like clang-tidy etc.
static forceinline void *XSPAN_GET_POISON_VOID_PTR() noexcept {
// return (void *) (upx_uintptr_t) 251; // NOLINT(performance-no-int-to-ptr)
return (void *) 251;
}
XSPAN_NAMESPACE_END
#ifndef XSPAN_DELETED_FUNCTION