Disable maybe-uninitialized warning all together. (#2210)

This commit is contained in:
Rot127 2023-11-30 02:21:02 +00:00 committed by GitHub
parent ce0b1b6744
commit 55818f2300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 13 deletions

View File

@ -25,10 +25,22 @@ project(capstone
VERSION 5.0
)
set(UNIX_COMPILER_OPTIONS -Werror -Wshift-negative-value -Wreturn-type -Wformat -Wmissing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context -Wmisleading-indentation)
# maybe-unitialzied is only supported by newer versions of GCC.
# Unfortunately, it is pretty unreliable and reports wrong results.
# So we disable it for all compilers versions which support it.
include(CheckCCompilerFlag)
check_c_compiler_flag("-Wno-maybe-unitialized" SUPPORTS_MU)
if (SUPPORTS_MU)
set(UNIX_COMPILER_OPTIONS ${UNIX_COMPILER_OPTIONS} -Wno-maybe-unitialized)
endif()
if (MSVC)
add_compile_options(/W1 /w14189)
else()
add_compile_options(-Werror -Wshift-negative-value -Wreturn-type -Wformat -Wmissing-braces -Wunused-function -Warray-bounds -Wunused-variable -Wparentheses -Wint-in-bool-context -Wmisleading-indentation)
add_compile_options(${UNIX_COMPILE_OPTIONS})
endif()

View File

@ -823,14 +823,6 @@ static inline uint64_t AArch64_AM_decodeAdvSIMDModImmType12(uint8_t Imm)
}
#if defined( __has_warning )
# if __has_warning( "-Wmaybe-uninitialized" )
# define WARNING_SUPRESSED
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
# endif
#endif
/// Returns true if Imm is the concatenation of a repeating pattern of type T.
#define DEFINE_isSVEMaskOfIdenticalElements(T) \
static inline bool CONCAT(AArch64_AM_isSVEMaskOfIdenticalElements, T)(int64_t Imm) \
@ -847,10 +839,6 @@ DEFINE_isSVEMaskOfIdenticalElements(int16_t);
DEFINE_isSVEMaskOfIdenticalElements(int32_t);
DEFINE_isSVEMaskOfIdenticalElements(int64_t);
#ifdef WARNING_SUPRESSED
#pragma GCC diagnostic pop
#endif
static inline bool AArch64_AM_isSVEMaskOfIdenticalElements64(int64_t Imm)
{
return true;