mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00: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:
parent
6668178cff
commit
95671c25ec
1 changed files with 1 additions and 0 deletions
|
@ -46,6 +46,7 @@ add_compile_flags("-nostdinc")
|
||||||
|
|
||||||
if(GCC_VERSION VERSION_GREATER 4.7)
|
if(GCC_VERSION VERSION_GREATER 4.7)
|
||||||
add_compile_flags("-mstackrealign")
|
add_compile_flags("-mstackrealign")
|
||||||
|
add_compile_flags("-fno-aggressive-loop-optimizations")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
|
|
Loading…
Reference in a new issue