]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Compiler warning expansion to defined
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 29 Jan 2023 16:49:11 +0000 (17:49 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 29 Jan 2023 16:49:11 +0000 (17:49 +0100)
Clang doesn't like
m_debuginfo/tinfl.c:182:45: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]

coregrind/m_debuginfo/tinfl.c

index 890e0c4dd4b8da0c779540de5032913149259c0a..970e0b82758a832179b8811e3572cdaa3a399943 100644 (file)
@@ -51,7 +51,6 @@ typedef ULong  mz_uint64;
 #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
 #endif
 
-#define MINIZ_LITTLE_ENDIAN       ( defined(VG_LITTLEENDIAN) )
 #define MINIZ_HAS_64BIT_REGISTERS ( VG_WORDSIZE == 8 )
 
 // Works around MSVC's spammy "warning C4127: conditional expression is
@@ -179,7 +178,7 @@ struct tinfl_decompressor_tag
 #define MZ_MIN(a,b) (((a)<(b))?(a):(b))
 #define MZ_CLEAR_OBJ(obj) VG_(memset)(&(obj), 0, sizeof(obj))
 
-#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
+#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && defined(VG_LITTLEENDIAN)
   #define MZ_READ_LE16(p) *((const mz_uint16 *)(p))
   #define MZ_READ_LE32(p) *((const mz_uint32 *)(p))
 #else