mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 01:12:39 +00:00
Warnings: add warnings as errors: 'switch' & 'return-type'
This commit is contained in:
parent
0b6bfb1fd8
commit
430b7586f6
1 changed files with 7 additions and 0 deletions
|
@ -744,6 +744,13 @@ else()
|
||||||
add_linker_flag_if_supported(-Wl,--high-entropy-va LD_SECURITY_FLAGS)
|
add_linker_flag_if_supported(-Wl,--high-entropy-va LD_SECURITY_FLAGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Warnings, that when ignored are so severe, that they can segfault or even UB any application.
|
||||||
|
# Treat them as errors.
|
||||||
|
add_c_flag_if_supported( -Werror=switch C_SECURITY_FLAGS)
|
||||||
|
add_cxx_flag_if_supported(-Werror=switch CXX_SECURITY_FLAGS)
|
||||||
|
add_c_flag_if_supported( -Werror=return-type C_SECURITY_FLAGS)
|
||||||
|
add_cxx_flag_if_supported(-Werror=return-type CXX_SECURITY_FLAGS)
|
||||||
|
|
||||||
message(STATUS "Using C security hardening flags: ${C_SECURITY_FLAGS}")
|
message(STATUS "Using C security hardening flags: ${C_SECURITY_FLAGS}")
|
||||||
message(STATUS "Using C++ security hardening flags: ${CXX_SECURITY_FLAGS}")
|
message(STATUS "Using C++ security hardening flags: ${CXX_SECURITY_FLAGS}")
|
||||||
message(STATUS "Using linker security hardening flags: ${LD_SECURITY_FLAGS}")
|
message(STATUS "Using linker security hardening flags: ${LD_SECURITY_FLAGS}")
|
||||||
|
|
Loading…
Reference in a new issue