src: avoid warnings when compiling with llvm-mingw-nightly

This commit is contained in:
Markus F.X.J. Oberhumer 2024-05-08 22:22:13 +02:00
parent 42759b94bd
commit 72c9769953
1 changed files with 12 additions and 12 deletions

View File

@ -37,9 +37,6 @@
#if (ACC_CC_MSC) #if (ACC_CC_MSC)
#pragma warning(disable : 4456) // -Wno-shadow #pragma warning(disable : 4456) // -Wno-shadow
#endif #endif
#if (ACC_CC_MSC && (_MSC_VER < 1900))
#pragma warning(disable : 4127) // warning C4127: conditional expression is constant
#endif
void lzma_compress_config_t::reset() noexcept { void lzma_compress_config_t::reset() noexcept {
pos_bits.reset(); pos_bits.reset();
@ -206,15 +203,12 @@ error:
// compress - cruft because of pseudo-COM layer // compress - cruft because of pseudo-COM layer
**************************************************************************/ **************************************************************************/
// ensure proper nullptr usage #if (ACC_CC_CLANG >= 0x080000)
// TODO later: examine why we need this in the first place #pragma clang diagnostic push
#undef NULL #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
// NOLINTBEGIN(clang-analyzer-optin.cplusplus.*) #elif (ACC_CC_GNUC >= 0x040700)
#define NULL nullptr #pragma GCC diagnostic push
// NOLINTEND(clang-analyzer-optin.cplusplus.*) #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
#if defined(__GNUC__)
#undef __null
#define __null nullptr
#endif #endif
#undef MSDOS #undef MSDOS
@ -316,6 +310,12 @@ STDMETHODIMP ProgressInfo::SetRatioInfo(const UInt64 *inSize, const UInt64 *outS
#include <lzma-sdk/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp> #include <lzma-sdk/C/7zip/Compress/RangeCoder/RangeCoderBit.cpp>
#undef RC_NORMALIZE #undef RC_NORMALIZE
#if (ACC_CC_CLANG >= 0x080000)
#pragma clang diagnostic pop
#elif (ACC_CC_GNUC >= 0x040700)
#pragma GCC diagnostic pop
#endif
int upx_lzma_compress(const upx_bytep src, unsigned src_len, upx_bytep dst, unsigned *dst_len, int upx_lzma_compress(const upx_bytep src, unsigned src_len, upx_bytep dst, unsigned *dst_len,
upx_callback_t *cb, int method, int level, upx_callback_t *cb, int method, int level,
const upx_compress_config_t *cconf_parm, upx_compress_result_t *cresult) { const upx_compress_config_t *cconf_parm, upx_compress_result_t *cresult) {