mirror of
https://github.com/capstone-engine/capstone.git
synced 2024-11-23 13:39:46 +00:00
Disable maybe-uninitialized warning all together. (#2210)
This commit is contained in:
parent
ce0b1b6744
commit
55818f2300
@ -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()
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user