mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-09 05:02:19 +00:00
[libc] Warn on use of global constructors in libc
Clang supports the `-Wglobal-constructors` flag which will indicate if a global constructor is being used. The current goal in `libc` is to make the constructors `constexpr` to prevent this from happening with straight construction. However, there are many other cases where we can emit a constructor that this won't catch. This should give warning if someone accidentally introduces a global constructor. Reviewed By: michaelrj Differential Revision: https://reviews.llvm.org/D155721
This commit is contained in:
parent
805ce9a696
commit
26a1849cca
@ -38,6 +38,7 @@ function(_get_common_compile_options output_var flags)
|
||||
list(APPEND compile_options "-Wnonportable-system-include-path")
|
||||
list(APPEND compile_options "-Wstrict-prototypes")
|
||||
list(APPEND compile_options "-Wthread-safety")
|
||||
list(APPEND compile_options "-Wglobal-constructors")
|
||||
endif()
|
||||
if(ADD_FMA_FLAG)
|
||||
if(LIBC_TARGET_ARCHITECTURE_IS_X86)
|
||||
|
Loading…
x
Reference in New Issue
Block a user