mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 21:24:32 +02:00
fix(heap): avoid malloc calls optimization
GCC defines that malloc(0) returns a non-null pointer (glibc behavior). This can break logic for some cases, because our implementation of malloc(0) returns null pointer. POSIX and the ISO C standard allow both behaviors.
This commit is contained in:
@@ -170,7 +170,7 @@ if(CONFIG_COMPILER_DUMP_RTL_FILES)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 15.0)
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 15.0)
|
||||||
list(APPEND c_compile_options "-fzero-init-padding-bits=all")
|
list(APPEND c_compile_options "-fzero-init-padding-bits=all" "-fno-malloc-dce")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
__generate_prefix_map(prefix_map_compile_options)
|
__generate_prefix_map(prefix_map_compile_options)
|
||||||
|
Reference in New Issue
Block a user