]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OS: Resolve redefinition of ‘testing_test_fail’ compilation error
authorAditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com>
Wed, 22 Oct 2025 09:05:32 +0000 (11:05 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 22 Oct 2025 09:17:49 +0000 (09:17 +0000)
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 <aditya.kumar.singh@oss.qualcomm.com>
src/utils/os_unix.c

index 000262964816788e4bbbc462b5c73dc04a9dc3bb..b9e588a6bd9b8bcf85dd4f1f130a754b3e3925f8 100644 (file)
@@ -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)
 {