Skip to content

Commit 922d5e1

Browse files
committed
Revert "[nrf toup] VerifyOrDie logging for constrained devices"
This reverts commit 4fd4724. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
1 parent 1377a77 commit 922d5e1

File tree

6 files changed

+1
-53
lines changed

6 files changed

+1
-53
lines changed

build/config/compiler/BUILD.gn

-6
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ declare_args() {
2727
# Enable -Werror. This can be disabled if using a different compiler
2828
# with unfixed or unsupported wanings.
2929
treat_warnings_as_errors = true
30-
31-
# Disable this to allow for overriding built-in defines, such as __FILE__.
32-
warn_builtin_macro_redefined = true
3330
}
3431

3532
if (current_cpu == "arm" || current_cpu == "arm64") {
@@ -212,9 +209,6 @@ config("disabled_warnings") {
212209
"-Wno-maybe-uninitialized",
213210
]
214211
}
215-
if (!warn_builtin_macro_redefined) {
216-
cflags += [ "-Wno-builtin-macro-redefined" ]
217-
}
218212
}
219213

220214
config("warnings_common") {

config/nrfconnect/chip-module/CMakeLists.txt

-9
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ if (CONFIG_NRF_802154_RADIO_DRIVER)
7878
zephyr_include_directories($<TARGET_PROPERTY:nrf-802154-driver-interface,INTERFACE_INCLUDE_DIRECTORIES>)
7979
endif()
8080

81-
if (CONFIG_CHIP_LOG_FILE_NAME)
82-
zephyr_compile_definitions(__FILE__=__FILE_NAME__)
83-
zephyr_compile_options(-Wno-builtin-macro-redefined)
84-
endif()
85-
8681
zephyr_get_compile_flags(ZEPHYR_CFLAGS_C C)
8782
matter_add_cflags("${ZEPHYR_CFLAGS_C}")
8883
zephyr_get_compile_flags(ZEPHYR_CFLAGS_CC CXX)
@@ -187,10 +182,6 @@ if (NOT CONFIG_CHIP_DEBUG_SYMBOLS)
187182
matter_add_gn_arg_string("symbol_level" "0")
188183
endif()
189184

190-
if (CONFIG_CHIP_LOG_FILE_NAME)
191-
matter_add_gn_arg_bool("warn_builtin_macro_redefined" FALSE)
192-
endif()
193-
194185
if (CHIP_COMPILER_LAUNCHER)
195186
matter_add_gn_arg_string("pw_command_launcher" ${CHIP_COMPILER_LAUNCHER})
196187
endif()

config/nrfconnect/chip-module/Kconfig

-16
Original file line numberDiff line numberDiff line change
@@ -144,22 +144,6 @@ config CHIP_DEBUG_SYMBOLS
144144
help
145145
Enables building the application with debug symbols.
146146

147-
config CHIP_LOG_VERIFY_OR_DIE
148-
bool "Log source code location on VerifyOrDie failure"
149-
help
150-
Enables the feature to log the file name and line number where the Matter
151-
stack calls the VerifyOrDie macro with the condition evaluating to false.
152-
153-
config CHIP_LOG_FILE_NAME
154-
bool "Log file name instead of entire file path"
155-
default y
156-
help
157-
Enables using a file name instead of an entire file path whenever the
158-
source code location needs to be logged. This is achieved by overriding
159-
the __FILE__ macro with __FILE_NAME__.
160-
This reduces the code size in debug configurations that enable verbose
161-
assertion macros.
162-
163147
config CHIP_MALLOC_SYS_HEAP
164148
default y if !ARCH_POSIX
165149

src/lib/core/CHIPConfig.h

-11
Original file line numberDiff line numberDiff line change
@@ -1024,17 +1024,6 @@ extern const char CHIP_NON_PRODUCTION_MARKER[];
10241024
#define CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE 0
10251025
#endif
10261026

1027-
/**
1028-
* @def CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE_NO_COND
1029-
*
1030-
* @brief If true, VerifyOrDie() built with @c CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE
1031-
* generates a short message that includes only the source code location,
1032-
* without the condition that fails.
1033-
*/
1034-
#ifndef CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE_NO_COND
1035-
#define CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE_NO_COND 0
1036-
#endif
1037-
10381027
/**
10391028
* @def CHIP_CONFIG_CONTROLLER_MAX_ACTIVE_DEVICES
10401029
*

src/lib/support/CodeUtils.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,7 @@ inline void chipDie(void)
527527
* @sa #chipDie
528528
*
529529
*/
530-
#if CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE && CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE_NO_COND
531-
#define VerifyOrDie(aCondition) \
532-
nlABORT_ACTION(aCondition, ChipLogError(Support, "VerifyOrDie failure at %s:%d", __FILE__, __LINE__))
533-
#elif CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE
530+
#if CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE
534531
#define VerifyOrDie(aCondition) \
535532
nlABORT_ACTION(aCondition, ChipLogError(Support, "VerifyOrDie failure at %s:%d: %s", __FILE__, __LINE__, #aCondition))
536533
#else // CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE

src/platform/nrfconnect/CHIPPlatformConfig.h

-7
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,3 @@
163163
#define CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER CONFIG_CHIP_ENABLE_BDX_LOG_TRANSFER
164164
#endif // CONFIG_CHIP_ENABLE_BDX_LOG_TRANSFER
165165
#endif // CHIP_CONFIG_ENABLE_BDX_LOG_TRANSFER
166-
167-
#ifdef CONFIG_CHIP_LOG_VERIFY_OR_DIE
168-
#define CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE 1
169-
#ifndef CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE_NO_COND
170-
#define CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE_NO_COND 1
171-
#endif // CHIP_CONFIG_VERBOSE_VERIFY_OR_DIE_NO_COND
172-
#endif // CONFIG_CHIP_LOG_VERIFY_OR_DIE

0 commit comments

Comments
 (0)