From: Aditya Kumar Singh Date: Wed, 22 Oct 2025 09:05:32 +0000 (+0200) Subject: OS: Resolve redefinition of ‘testing_test_fail’ compilation error X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff35b4de3ab3e180749102aec2693f0e7a2494ce;p=thirdparty%2Fhostap.git OS: Resolve redefinition of ‘testing_test_fail’ compilation error Building the source tree with WPA_TRACE, but without WPA_TRACE_BFD and CONFIG_TESTING_OPTIONS leads to a compilation error: ../src/utils/os_unix.c:720:19: error: redefinition of ‘testing_test_fail’ static inline int testing_test_fail(const char *tag, bool is_alloc) ^~~~~~~~~~~~~~~~~ In file included from ../src/utils/os_unix.c:26:0: ../src/utils/os.h:696:19: note: previous definition of ‘testing_test_fail’ was here static inline int testing_test_fail(const char *tag, bool is_alloc) ^~~~~~~~~~~~~~~~~ Fix this by removing redefinition in os_unix.c since recent commit 126f243eb767 ("trace: Define TEST_FAIL and TEST_FAIL_TAG as inline function") has added a static declaration already in os.h. Fixes: 126f243eb767 ("trace: Define TEST_FAIL and TEST_FAIL_TAG as inline function") Signed-off-by: Aditya Kumar Singh --- diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index 000262964..b9e588a6b 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -714,15 +714,7 @@ int testing_get_fail_pattern(bool is_alloc, char *buf, size_t buflen) return -1; #endif /* WPA_TRACE_BFD */ } - -#else /* defined(WPA_TRACE_BFD) && defined(CONFIG_TESTING_OPTIONS) */ - -static inline int testing_test_fail(const char *tag, bool is_alloc) -{ - return 0; -} - -#endif +#endif /* defined(WPA_TRACE_BFD) && defined(CONFIG_TESTING_OPTIONS) */ void * os_malloc(size_t size) {