diff --git a/AWSCRTAndroidTestRunner/app/src/main/cpp/CMakeLists.txt b/AWSCRTAndroidTestRunner/app/src/main/cpp/CMakeLists.txt index a5e57e30d..9a91baba4 100644 --- a/AWSCRTAndroidTestRunner/app/src/main/cpp/CMakeLists.txt +++ b/AWSCRTAndroidTestRunner/app/src/main/cpp/CMakeLists.txt @@ -3,7 +3,7 @@ # Sets the minimum version of CMake required to build the native library. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.9) # AWS lib set(path_to_common "${CMAKE_CURRENT_LIST_DIR}/../../../../..") diff --git a/CMakeLists.txt b/CMakeLists.txt index d7cedeef9..6d14b0241 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,15 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. -cmake_minimum_required(VERSION 3.0) +# As of October 2024, we picked 3.9 as our version because internally we still support RHEL5 and AL2012, and CMake 3.9 +# was the latest version available on those platforms. +cmake_minimum_required(VERSION 3.9) option(ALLOW_CROSS_COMPILED_TESTS "Allow tests to be compiled via cross compile, for use with qemu" OFF) project(aws-c-common LANGUAGES C VERSION 0.1.0) message(STATUS "CMake ${CMAKE_VERSION}") -if (POLICY CMP0069) - cmake_policy(SET CMP0069 NEW) # Enable LTO/IPO if available in the compiler, see AwsCFlags -endif() - if (POLICY CMP0077) cmake_policy(SET CMP0077 OLD) # Enable options to get their values from normal variables endif() @@ -189,7 +187,6 @@ file(GLOB COMMON_SRC ${AWS_COMMON_EXTERNAL_SRC} ) - add_library(${PROJECT_NAME} ${COMMON_SRC}) aws_set_common_properties(${PROJECT_NAME} NO_WEXTRA) aws_prepare_symbol_visibility_args(${PROJECT_NAME} "AWS_COMMON") diff --git a/cmake/AwsCFlags.cmake b/cmake/AwsCFlags.cmake index 470f6db18..18ebb712c 100644 --- a/cmake/AwsCFlags.cmake +++ b/cmake/AwsCFlags.cmake @@ -4,7 +4,6 @@ include(CheckCCompilerFlag) include(CheckIncludeFile) include(CheckSymbolExists) -include(CMakeParseArguments) # needed for CMake v3.4 and lower option(AWS_ENABLE_LTO "Enables LTO on libraries. Ensure this is set on all consumed targets, or linking will fail" OFF) option(LEGACY_COMPILER_SUPPORT "This enables builds with compiler versions such as gcc 4.1.2. This is not a 'supported' feature; it's just a best effort." OFF) @@ -173,6 +172,7 @@ function(aws_set_common_properties target) set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--exclude-libs,libcrypto.a") endif() + endif() check_include_file(stdint.h HAS_STDINT) @@ -230,30 +230,18 @@ function(aws_set_common_properties target) set(_ENABLE_LTO_EXPR $>) # try to check whether compiler supports LTO/IPO - if (POLICY CMP0069) - cmake_policy(SET CMP0069 NEW) - include(CheckIPOSupported OPTIONAL RESULT_VARIABLE ipo_check_exists) - if (ipo_check_exists) - check_ipo_supported(RESULT ipo_supported) - if (ipo_supported) - message(STATUS "Enabling IPO/LTO for Release builds") - else() - message(STATUS "AWS_ENABLE_LTO is enabled, but cmake/compiler does not support it, disabling") - set(_ENABLE_LTO_EXPR OFF) - endif() - endif() + include(CheckIPOSupported) + check_ipo_supported(RESULT ipo_supported) + if (ipo_supported) + message(STATUS "Enabling IPO/LTO for Release builds") + else() + message(STATUS "AWS_ENABLE_LTO is enabled, but cmake/compiler does not support it, disabling") + set(_ENABLE_LTO_EXPR OFF) endif() else() set(_ENABLE_LTO_EXPR OFF) endif() - if(BUILD_SHARED_LIBS) - if (NOT MSVC) - # this should only be set when building shared libs. - list(APPEND AWS_C_FLAGS "-fvisibility=hidden") - endif() - endif() - if(AWS_ENABLE_TRACING) target_link_libraries(${target} PRIVATE ittnotify) else() @@ -264,4 +252,11 @@ function(aws_set_common_properties target) target_compile_definitions(${target} PRIVATE ${AWS_C_DEFINES_PRIVATE} PUBLIC ${AWS_C_DEFINES_PUBLIC}) set_target_properties(${target} PROPERTIES LINKER_LANGUAGE C C_STANDARD 99 C_STANDARD_REQUIRED ON) set_target_properties(${target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION ${_ENABLE_LTO_EXPR}>) + + # Don't hide symbols in Debug builds. + # We do this so that backtraces are more likely to show function names. + # We mostly use backtraces to diagnose memory leaks. + if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + set_target_properties(${target} PROPERTIES C_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON) + endif () endfunction() diff --git a/cmake/AwsPrebuildDependency.cmake b/cmake/AwsPrebuildDependency.cmake index c0048f20a..0a52f69a8 100644 --- a/cmake/AwsPrebuildDependency.cmake +++ b/cmake/AwsPrebuildDependency.cmake @@ -25,11 +25,13 @@ function(aws_prebuild_dependency) set(depInstallDir ${depBinaryDir}/install) file(MAKE_DIRECTORY ${depBinaryDir}) + # Convert prefix path from list to escaped string, to be passed on command line + string(REPLACE ";" "\\\\;" ESCAPED_PREFIX_PATH "${CMAKE_PREFIX_PATH}") # For execute_process to accept a dynamically constructed command, it should be passed in a list format. - set(cmakeCommand "COMMAND" "${CMAKE_COMMAND}") - list(APPEND cmakeCommand -S ${AWS_PREBUILD_SOURCE_DIR}) + set(cmakeCommand "${CMAKE_COMMAND}") + list(APPEND cmakeCommand ${AWS_PREBUILD_SOURCE_DIR}) list(APPEND cmakeCommand -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}) - list(APPEND cmakeCommand -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}) + list(APPEND cmakeCommand -DCMAKE_PREFIX_PATH=${ESCAPED_PREFIX_PATH}) list(APPEND cmakeCommand -DCMAKE_INSTALL_PREFIX=${depInstallDir}) list(APPEND cmakeCommand -DCMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH}) list(APPEND cmakeCommand -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}) @@ -39,11 +41,13 @@ function(aws_prebuild_dependency) list(APPEND cmakeCommand ${AWS_PREBUILD_CMAKE_ARGUMENTS}) endif() - list(APPEND cmakeCommand WORKING_DIRECTORY ${depBinaryDir}) - list(APPEND cmakeCommand RESULT_VARIABLE result) - # Configure dependency project. - execute_process(${cmakeCommand}) + execute_process( + COMMAND ${cmakeCommand} + WORKING_DIRECTORY ${depBinaryDir} + RESULT_VARIABLE result + ) + if (NOT ${result} EQUAL 0) message(FATAL_ERROR "Configuration failed for dependency project ${AWS_PREBUILD_DEPENDENCY_NAME}") endif() diff --git a/cmake/AwsSIMD.cmake b/cmake/AwsSIMD.cmake index 753e53397..c9bb3c155 100644 --- a/cmake/AwsSIMD.cmake +++ b/cmake/AwsSIMD.cmake @@ -19,6 +19,7 @@ else() set(AWS_CLMUL_FLAG "-mpclmul") set(AWS_SSE4_2_FLAG "-msse4.2") + # AWS Graviton3 processors use neoverse-v1 check_c_compiler_flag("-mtune=neoverse-v1" HAVE_MTUNE_NEOVERSE_V1) if (HAVE_MTUNE_NEOVERSE_V1) set(AWS_ARMv8_1_FLAG "-march=armv8-a+crc+crypto -mtune=neoverse-v1") @@ -58,7 +59,7 @@ if (USE_CPU_EXTENSIONS) _mm256_permutevar8x32_epi32(vec, vec); return 0; - }" AWS_HAVE_AVX2_INTRINSICS) + }" AWS_HAVE_AVX2_INTRINSICS) check_c_source_compiles(" #include diff --git a/cmake/AwsTestHarness.cmake b/cmake/AwsTestHarness.cmake index 484b66635..a63ad61a7 100644 --- a/cmake/AwsTestHarness.cmake +++ b/cmake/AwsTestHarness.cmake @@ -39,9 +39,9 @@ function(generate_test_driver driver_exe_name) add_executable(${driver_exe_name} ${CMAKE_CURRENT_BINARY_DIR}/test_runner.c ${TESTS}) aws_set_common_properties(${driver_exe_name} NO_WEXTRA NO_PEDANTIC) - # Some versions of CMake (3.9-3.11) generate a test_runner.c file with - # a strncpy() call that triggers the "stringop-overflow" warning in GCC 8.1+ - # This warning doesn't exist until GCC 7 though, so test for it before disabling. + # Some versions of CMake (3.9-3.11) generate a test_runner.c file with + # a strncpy() call that triggers the "stringop-overflow" warning in GCC 8.1+ + # This warning doesn't exist until GCC 7 though, so test for it before disabling. if (NOT MSVC) check_c_compiler_flag(-Wno-stringop-overflow HAS_WNO_STRINGOP_OVERFLOW) if (HAS_WNO_STRINGOP_OVERFLOW) @@ -57,6 +57,9 @@ function(generate_test_driver driver_exe_name) target_compile_definitions(${driver_exe_name} PRIVATE AWS_UNSTABLE_TESTING_API=1) target_include_directories(${driver_exe_name} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) + # Export symbols so that backtraces are more likely to show function names. + set_target_properties(${driver_exe_name} PROPERTIES ENABLE_EXPORTS ON) + foreach(name IN LISTS TEST_CASES) add_test(${name} ${driver_exe_name} "${name}") set_tests_properties("${name}" PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE_VALUE}) diff --git a/include/aws/common/array_list.h b/include/aws/common/array_list.h index 4ef924456..4cd05bb7d 100644 --- a/include/aws/common/array_list.h +++ b/include/aws/common/array_list.h @@ -231,11 +231,11 @@ void aws_array_list_swap(struct aws_array_list *AWS_RESTRICT list, size_t a, siz AWS_COMMON_API void aws_array_list_sort(struct aws_array_list *AWS_RESTRICT list, aws_array_list_comparator_fn *compare_fn); +AWS_EXTERN_C_END #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_ARRAY_LIST_H */ diff --git a/include/aws/common/atomics.h b/include/aws/common/atomics.h index 7f5445334..a4fa72e38 100644 --- a/include/aws/common/atomics.h +++ b/include/aws/common/atomics.h @@ -318,11 +318,12 @@ size_t aws_atomic_fetch_xor(volatile struct aws_atomic_var *var, size_t n); AWS_STATIC_IMPL void aws_atomic_thread_fence(enum aws_memory_order order); +AWS_EXTERN_C_END + #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif diff --git a/include/aws/common/atomics.inl b/include/aws/common/atomics.inl index 3763fb4d5..306504fb1 100644 --- a/include/aws/common/atomics.inl +++ b/include/aws/common/atomics.inl @@ -127,6 +127,7 @@ AWS_STATIC_IMPL size_t aws_atomic_fetch_xor(volatile struct aws_atomic_var *var, size_t n) { return aws_atomic_fetch_xor_explicit(var, n, aws_memory_order_seq_cst); } +AWS_EXTERN_C_END /* Include the backend implementation now, because we'll use its typedefs and #defines below */ #if defined(__GNUC__) || defined(__clang__) @@ -143,6 +144,4 @@ size_t aws_atomic_fetch_xor(volatile struct aws_atomic_var *var, size_t n) { #include -AWS_EXTERN_C_END - #endif /* AWS_COMMON_ATOMICS_INL */ diff --git a/include/aws/common/byte_order.h b/include/aws/common/byte_order.h index b42f7a666..c2bd0d1b5 100644 --- a/include/aws/common/byte_order.h +++ b/include/aws/common/byte_order.h @@ -66,11 +66,11 @@ AWS_STATIC_IMPL uint16_t aws_hton16(uint16_t x); */ AWS_STATIC_IMPL uint16_t aws_ntoh16(uint16_t x); +AWS_EXTERN_C_END #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_BYTE_ORDER_H */ diff --git a/include/aws/common/clock.h b/include/aws/common/clock.h index f1ca14877..d385cb46b 100644 --- a/include/aws/common/clock.h +++ b/include/aws/common/clock.h @@ -54,11 +54,12 @@ int aws_high_res_clock_get_ticks(uint64_t *timestamp); AWS_COMMON_API int aws_sys_clock_get_ticks(uint64_t *timestamp); +AWS_EXTERN_C_END + #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_CLOCK_H */ diff --git a/include/aws/common/condition_variable.h b/include/aws/common/condition_variable.h index 82431dd4f..a4eb1bdfe 100644 --- a/include/aws/common/condition_variable.h +++ b/include/aws/common/condition_variable.h @@ -69,14 +69,17 @@ AWS_COMMON_API int aws_condition_variable_notify_all(struct aws_condition_variable *condition_variable); /** - * Waits the calling thread on a notification from another thread. + * Waits the calling thread on a notification from another thread. This function must be called with the mutex locked + * by the calling thread otherwise the behavior is undefined. Spurious wakeups can occur and to avoid this causing + * any problems use the _pred version of this function. */ AWS_COMMON_API int aws_condition_variable_wait(struct aws_condition_variable *condition_variable, struct aws_mutex *mutex); /** * Waits the calling thread on a notification from another thread. If predicate returns false, the wait is reentered, - * otherwise control returns to the caller. + * otherwise control returns to the caller. This function must be called with the mutex locked by the calling thread + * otherwise the behavior is undefined. */ AWS_COMMON_API int aws_condition_variable_wait_pred( @@ -87,7 +90,8 @@ int aws_condition_variable_wait_pred( /** * Waits the calling thread on a notification from another thread. Times out after time_to_wait. time_to_wait is in - * nanoseconds. + * nanoseconds. This function must be called with the mutex locked by the calling thread otherwise the behavior is + * undefined. Spurious wakeups can occur and to avoid this causing any problems use the _pred version of this function. */ AWS_COMMON_API int aws_condition_variable_wait_for( @@ -97,7 +101,8 @@ int aws_condition_variable_wait_for( /** * Waits the calling thread on a notification from another thread. Times out after time_to_wait. time_to_wait is in - * nanoseconds. If predicate returns false, the wait is reentered, otherwise control returns to the caller. + * nanoseconds. If predicate returns false, the wait is reentered, otherwise control returns to the caller. This + * function must be called with the mutex locked by the calling thread otherwise the behavior is undefined. */ AWS_COMMON_API int aws_condition_variable_wait_for_pred( diff --git a/include/aws/common/encoding.h b/include/aws/common/encoding.h index b5f4d88e3..89e4df2e6 100644 --- a/include/aws/common/encoding.h +++ b/include/aws/common/encoding.h @@ -224,11 +224,12 @@ AWS_COMMON_API int aws_utf8_decoder_update(struct aws_utf8_decoder *decoder, str */ AWS_COMMON_API int aws_utf8_decoder_finalize(struct aws_utf8_decoder *decoder); +AWS_EXTERN_C_END + #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_ENCODING_H */ diff --git a/include/aws/common/error.h b/include/aws/common/error.h index a798b6677..b8ecdc88b 100644 --- a/include/aws/common/error.h +++ b/include/aws/common/error.h @@ -149,12 +149,11 @@ int aws_translate_and_raise_io_error_or(int error_no, int fallback_aws_error_cod AWS_COMMON_API int aws_translate_and_raise_io_error(int error_no); +AWS_EXTERN_C_END #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END - enum aws_common_error { AWS_ERROR_SUCCESS = AWS_ERROR_ENUM_BEGIN_RANGE(AWS_C_COMMON_PACKAGE_ID), AWS_ERROR_OOM, diff --git a/include/aws/common/linked_list.h b/include/aws/common/linked_list.h index cb0ce655c..bd2e5d891 100644 --- a/include/aws/common/linked_list.h +++ b/include/aws/common/linked_list.h @@ -186,11 +186,11 @@ AWS_STATIC_IMPL void aws_linked_list_move_all_front( * Returns true if the node is currently in a list, false otherwise. */ AWS_STATIC_IMPL bool aws_linked_list_node_is_in_list(struct aws_linked_list_node *node); +AWS_EXTERN_C_END #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_LINKED_LIST_H */ diff --git a/include/aws/common/math.h b/include/aws/common/math.h index 7d0f97b61..8a8a00118 100644 --- a/include/aws/common/math.h +++ b/include/aws/common/math.h @@ -200,11 +200,11 @@ AWS_STATIC_IMPL float aws_max_float(float a, float b); AWS_STATIC_IMPL double aws_min_double(double a, double b); AWS_STATIC_IMPL double aws_max_double(double a, double b); +AWS_EXTERN_C_END #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_MATH_H */ diff --git a/include/aws/common/math.inl b/include/aws/common/math.inl index ad3590623..002ff8178 100644 --- a/include/aws/common/math.inl +++ b/include/aws/common/math.inl @@ -13,8 +13,6 @@ #include #include -AWS_EXTERN_C_BEGIN - #if defined(AWS_HAVE_GCC_OVERFLOW_MATH_EXTENSIONS) && (defined(__clang__) || !defined(__cplusplus)) /* * GCC and clang have these super convenient overflow checking builtins... @@ -48,6 +46,8 @@ AWS_EXTERN_C_BEGIN # include #endif +AWS_EXTERN_C_BEGIN + #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable : 4127) /*Disable "conditional expression is constant" */ diff --git a/include/aws/common/ring_buffer.h b/include/aws/common/ring_buffer.h index 24cddd09f..e798d5d1d 100644 --- a/include/aws/common/ring_buffer.h +++ b/include/aws/common/ring_buffer.h @@ -93,11 +93,12 @@ AWS_COMMON_API bool aws_ring_buffer_buf_belongs_to_pool( const struct aws_ring_buffer *ring_buffer, const struct aws_byte_buf *buf); +AWS_EXTERN_C_END + #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_RING_BUFFER_H */ diff --git a/include/aws/common/string.h b/include/aws/common/string.h index da4482abf..37ec2f99e 100644 --- a/include/aws/common/string.h +++ b/include/aws/common/string.h @@ -373,11 +373,12 @@ bool aws_c_string_is_valid(const char *str); AWS_STATIC_IMPL bool aws_char_is_space(uint8_t c); +AWS_EXTERN_C_END + #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_STRING_H */ diff --git a/include/aws/common/zero.h b/include/aws/common/zero.h index e83cf454b..f04f5a84d 100644 --- a/include/aws/common/zero.h +++ b/include/aws/common/zero.h @@ -56,11 +56,12 @@ bool aws_is_mem_zeroed(const void *buf, size_t bufsize); AWS_COMMON_API void aws_secure_zero(void *pBuf, size_t bufsize); +AWS_EXTERN_C_END + #ifndef AWS_NO_STATIC_IMPL # include #endif /* AWS_NO_STATIC_IMPL */ -AWS_EXTERN_C_END AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_ZERO_H */ diff --git a/tests/memtrace_test.c b/tests/memtrace_test.c index b3be1b7e9..c161752b8 100644 --- a/tests/memtrace_test.c +++ b/tests/memtrace_test.c @@ -101,7 +101,7 @@ static int s_test_memtrace_stacks(struct aws_allocator *allocator, void *ctx) { /* only bother to run this test if the platform can do a backtrace */ void *probe_stack[1]; if (!aws_backtrace(probe_stack, 1)) { - return 0; + return AWS_OP_SKIP; } test_logger_init(&s_test_logger, allocator, AWS_LL_TRACE, 0); @@ -146,27 +146,26 @@ static int s_test_memtrace_stacks(struct aws_allocator *allocator, void *ctx) { /* if this is not a debug build, there may not be symbols, so the test cannot * verify if a best effort was made */ #if defined(DEBUG_BUILD) - /* fprintf(stderr, "%s\n", test_logger->log_buffer.buffer); */ + fprintf(stderr, "%s\n", test_logger->log_buffer.buffer); char s_alloc_1_addr[32]; char s_alloc_2_addr[32]; char s_alloc_3_addr[32]; char s_alloc_4_addr[32]; # if defined(_MSC_VER) -# pragma warning(push) # pragma warning(disable : 4054) /* type cast function pointer to data pointer */ +# endif + snprintf(s_alloc_1_addr, AWS_ARRAY_SIZE(s_alloc_1_addr), "0x%tx", (uintptr_t)(void *)s_alloc_1); snprintf(s_alloc_2_addr, AWS_ARRAY_SIZE(s_alloc_2_addr), "0x%tx", (uintptr_t)(void *)s_alloc_2); snprintf(s_alloc_3_addr, AWS_ARRAY_SIZE(s_alloc_3_addr), "0x%tx", (uintptr_t)(void *)s_alloc_3); snprintf(s_alloc_4_addr, AWS_ARRAY_SIZE(s_alloc_4_addr), "0x%tx", (uintptr_t)(void *)s_alloc_4); -# pragma warning(pop) -# endif /* defined(_MSC_VER) */ const char *log_buffer = (const char *)test_logger->log_buffer.buffer; ASSERT_TRUE(strstr(log_buffer, "s_alloc_1") || strstr(log_buffer, s_alloc_1_addr)); ASSERT_TRUE(strstr(log_buffer, "s_alloc_2") || strstr(log_buffer, s_alloc_2_addr)); ASSERT_TRUE(strstr(log_buffer, "s_alloc_3") || strstr(log_buffer, s_alloc_3_addr)); ASSERT_TRUE(strstr(log_buffer, "s_alloc_4") || strstr(log_buffer, s_alloc_4_addr)); -#endif +#endif /* DEBUG_BUILD */ /* reset log */ aws_byte_buf_reset(&test_logger->log_buffer, true);