mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
CI updates
This commit is contained in:
parent
1d2b276425
commit
e4de14612f
|
@ -22,7 +22,7 @@ Checks: >
|
||||||
-clang-analyzer-optin.performance.Padding,
|
-clang-analyzer-optin.performance.Padding,
|
||||||
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
||||||
-clang-analyzer-security.insecureAPI.strcpy,
|
-clang-analyzer-security.insecureAPI.strcpy,
|
||||||
clang-diagnostics-*,
|
clang-diagnostic-*,
|
||||||
performance-*,
|
performance-*,
|
||||||
-performance-avoid-endl,
|
-performance-avoid-endl,
|
||||||
-performance-unnecessary-value-param,
|
-performance-unnecessary-value-param,
|
||||||
|
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -17,8 +17,8 @@ env:
|
||||||
UPX_CMAKE_CONFIG_FLAGS: -Wdev --warn-uninitialized
|
UPX_CMAKE_CONFIG_FLAGS: -Wdev --warn-uninitialized
|
||||||
UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO: 1
|
UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO: 1
|
||||||
UPX_DEBUG_TEST_LIBC_QSORT: 1
|
UPX_DEBUG_TEST_LIBC_QSORT: 1
|
||||||
# 2024-04-14
|
# 2024-04-20
|
||||||
ZIG_DIST_VERSION: 0.12.0-dev.3653+e45bdc6bd
|
ZIG_DIST_VERSION: 0.12.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
job-rebuild-and-verify-stubs:
|
job-rebuild-and-verify-stubs:
|
||||||
|
|
|
@ -16,7 +16,7 @@ Checks: >
|
||||||
-clang-analyzer-core.UndefinedBinaryOperatorResult,
|
-clang-analyzer-core.UndefinedBinaryOperatorResult,
|
||||||
-clang-analyzer-core.uninitialized.Assign,
|
-clang-analyzer-core.uninitialized.Assign,
|
||||||
-clang-analyzer-security.insecureAPI.strcpy,
|
-clang-analyzer-security.insecureAPI.strcpy,
|
||||||
clang-diagnostics-*,
|
clang-diagnostic-*,
|
||||||
performance-*,
|
performance-*,
|
||||||
FormatStyle: file
|
FormatStyle: file
|
||||||
HeaderFilterRegex: '.*'
|
HeaderFilterRegex: '.*'
|
||||||
|
|
|
@ -14,7 +14,7 @@ Checks: >
|
||||||
-bugprone-suspicious-include,
|
-bugprone-suspicious-include,
|
||||||
clang-analyzer-*,
|
clang-analyzer-*,
|
||||||
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
||||||
clang-diagnostics-*,
|
clang-diagnostic-*,
|
||||||
performance-*,
|
performance-*,
|
||||||
FormatStyle: file
|
FormatStyle: file
|
||||||
HeaderFilterRegex: '.*'
|
HeaderFilterRegex: '.*'
|
||||||
|
|
|
@ -15,7 +15,7 @@ Checks: >
|
||||||
clang-analyzer-*,
|
clang-analyzer-*,
|
||||||
-clang-analyzer-optin.performance.Padding,
|
-clang-analyzer-optin.performance.Padding,
|
||||||
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
||||||
clang-diagnostics-*,
|
clang-diagnostic-*,
|
||||||
performance-*,
|
performance-*,
|
||||||
FormatStyle: file
|
FormatStyle: file
|
||||||
HeaderFilterRegex: '.*'
|
HeaderFilterRegex: '.*'
|
||||||
|
|
|
@ -18,7 +18,7 @@ Checks: >
|
||||||
-clang-analyzer-core.UndefinedBinaryOperatorResult,
|
-clang-analyzer-core.UndefinedBinaryOperatorResult,
|
||||||
-clang-analyzer-deadcode.DeadStores,
|
-clang-analyzer-deadcode.DeadStores,
|
||||||
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
|
||||||
clang-diagnostics-*,
|
clang-diagnostic-*,
|
||||||
performance-*,
|
performance-*,
|
||||||
-performance-no-int-to-ptr,
|
-performance-no-int-to-ptr,
|
||||||
FormatStyle: file
|
FormatStyle: file
|
||||||
|
|
|
@ -370,28 +370,6 @@ static noinline double u64_f64_sub_div(upx_uint64_t a, upx_uint64_t b) {
|
||||||
return (a - b) / 1000000.0;
|
return (a - b) / 1000000.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// extra debugging; floating point edge cases cause portability problems in practice
|
|
||||||
static noinline bool shall_test_float_division_by_zero(void) {
|
|
||||||
static bool result = false; // default is false
|
|
||||||
static upx_std_once_flag init_done;
|
|
||||||
upx_std_call_once(init_done, []() noexcept {
|
|
||||||
static const char envvar[] = "UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO";
|
|
||||||
const char *e = upx_getenv(envvar);
|
|
||||||
bool force = (e && e[0] && strcmp(e, "2") == 0);
|
|
||||||
if (force)
|
|
||||||
result = true;
|
|
||||||
else if (is_envvar_true(envvar)) {
|
|
||||||
#if defined(__clang__) && defined(__FAST_MATH__) && defined(__INTEL_LLVM_COMPILER)
|
|
||||||
// warning: comparison with NaN always evaluates to false in fast floating point modes
|
|
||||||
fprintf(stderr, "upx: WARNING: ignoring %s: __FAST_MATH__\n", envvar);
|
|
||||||
#else
|
|
||||||
result = true;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class Int, class Float>
|
template <class Int, class Float>
|
||||||
struct TestFloat {
|
struct TestFloat {
|
||||||
static constexpr Int X = 1000000;
|
static constexpr Int X = 1000000;
|
||||||
|
@ -407,10 +385,16 @@ struct TestFloat {
|
||||||
assert_noexcept(sub_div(3 * X, X, Float(X)) == Float(2));
|
assert_noexcept(sub_div(3 * X, X, Float(X)) == Float(2));
|
||||||
assert_noexcept(sub_div_x(3 * X, X) == Float(2));
|
assert_noexcept(sub_div_x(3 * X, X) == Float(2));
|
||||||
// extra debugging; floating point edge cases cause portability problems in practice
|
// extra debugging; floating point edge cases cause portability problems in practice
|
||||||
if (shall_test_float_division_by_zero()) {
|
static const char envvar[] = "UPX_DEBUG_TEST_FLOAT_DIVISION_BY_ZERO";
|
||||||
|
if (is_envvar_true(envvar)) {
|
||||||
|
#if defined(__FAST_MATH__)
|
||||||
|
// warning: comparison with NaN always evaluates to false in fast floating point modes
|
||||||
|
fprintf(stderr, "upx: WARNING: ignoring %s: __FAST_MATH__\n", envvar);
|
||||||
|
#else
|
||||||
assert_noexcept(std::isnan(div(0, Float(0))));
|
assert_noexcept(std::isnan(div(0, Float(0))));
|
||||||
assert_noexcept(std::isinf(div(1, Float(0))));
|
assert_noexcept(std::isinf(div(1, Float(0))));
|
||||||
assert_noexcept(std::isinf(div(Int(-1), Float(0))));
|
assert_noexcept(std::isinf(div(Int(-1), Float(0))));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -364,11 +364,15 @@ struct TestTriBool {
|
||||||
static_assert(std::is_trivially_copyable<T>::value);
|
static_assert(std::is_trivially_copyable<T>::value);
|
||||||
static_assert(sizeof(typename T::value_type) == sizeof(typename T::underlying_type));
|
static_assert(sizeof(typename T::value_type) == sizeof(typename T::underlying_type));
|
||||||
static_assert(alignof(typename T::value_type) == alignof(typename T::underlying_type));
|
static_assert(alignof(typename T::value_type) == alignof(typename T::underlying_type));
|
||||||
#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
|
#if defined(__m68k__) && defined(__atarist__) && defined(__GNUC__)
|
||||||
// broken compiler or broken ABI
|
// broken compiler or broken ABI
|
||||||
#elif __GNUC__ == 7 && defined(__i386__) && !defined(__clang__)
|
#elif defined(__i386__) && defined(__clang__) && (__clang_major__ < 9)
|
||||||
static_assert(sizeof(T) == sizeof(typename T::underlying_type));
|
static_assert(sizeof(T) == sizeof(typename T::underlying_type));
|
||||||
// gcc-7 "long long" enum align bug/ABI problem on i386
|
// i386: "long long" enum align bug/ABI problem on older compilers
|
||||||
|
static_assert(alignof(T) <= alignof(typename T::underlying_type));
|
||||||
|
#elif defined(__i386__) && defined(__GNUC__) && (__GNUC__ == 7) && !defined(__clang__)
|
||||||
|
static_assert(sizeof(T) == sizeof(typename T::underlying_type));
|
||||||
|
// i386: "long long" enum align bug/ABI problem on older compilers
|
||||||
static_assert(alignof(T) <= alignof(typename T::underlying_type));
|
static_assert(alignof(T) <= alignof(typename T::underlying_type));
|
||||||
#else
|
#else
|
||||||
static_assert(sizeof(T) == sizeof(typename T::underlying_type));
|
static_assert(sizeof(T) == sizeof(typename T::underlying_type));
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__clang__) && defined(__FAST_MATH__) && defined(__INTEL_LLVM_COMPILER)
|
#if defined(__clang__) && defined(__FAST_MATH__)
|
||||||
// warning: comparison with NaN always evaluates to false in fast floating point modes
|
// warning: comparison with NaN always evaluates to false in fast floating point modes
|
||||||
#pragma clang diagnostic ignored "-Wtautological-constant-compare"
|
#pragma clang diagnostic ignored "-Wtautological-constant-compare"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user