mirror of
https://github.com/reactos/reactos.git
synced 2026-06-06 13:47:40 +08:00
[CMAKE] Add -fno-aggressive-loop-optimizations flag
ReactOS/Windows headers contain lots of structures whose last field is fieldName[ANYSIZE] or fieldName[1]. Starting with GCC 4.8, gcc considers that accessing items [2], [3], ... are undefined operation, and may optimize those accesses by removing them! Add flag -fno-aggressive-loop-optimizations to prevent this unwanted behaviour.
This commit is contained in:
@@ -46,6 +46,7 @@ add_compile_flags("-nostdinc")
|
||||
|
||||
if(GCC_VERSION VERSION_GREATER 4.7)
|
||||
add_compile_flags("-mstackrealign")
|
||||
add_compile_flags("-fno-aggressive-loop-optimizations")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
|
||||
Reference in New Issue
Block a user