mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-01 14:58:18 +00:00
[cmake] Add -Wcast-qual to C flags if LLVM_ENABLE_WARNINGS is defined.
Disable this warning for specific cast in llvm_regcomp(). Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D153911
This commit is contained in:
parent
b43df5bfe7
commit
621d1d07d9
@ -741,7 +741,7 @@ if (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))
|
||||
endif()
|
||||
|
||||
append("-Wextra -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
append("-Wcast-qual" CMAKE_CXX_FLAGS)
|
||||
append("-Wcast-qual" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
|
||||
# Turn off missing field initializer warnings for gcc to avoid noise from
|
||||
# false positives with empty {}. Turn them on otherwise (they're off by
|
||||
|
@ -329,7 +329,15 @@ llvm_regcomp(llvm_regex_t *preg, const char *pattern, int cflags)
|
||||
|
||||
/* set things up */
|
||||
p->g = g;
|
||||
/* suppress warning from the following explicit cast. */
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||
#endif /* __GNUC__ */
|
||||
p->next = (char *)pattern; /* convenience; we do not modify it */
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC diagnostic pop
|
||||
#endif /* __GNUC__ */
|
||||
p->end = p->next + len;
|
||||
p->error = 0;
|
||||
p->ncsalloc = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user