Skip to content

Commit 9c2a17a

Browse files
committed
remove <nuttx/xxx.h> in stdio need add depend header file
Error: cmocka/src/cmocka.c:2568:9: error: implicit declaration of function 'ftruncate'; did you mean 'strncat'? [-Werror=implicit-function-declaration] 2568 | ftruncate(fileno(fp), ftell(fp)); | ^~~~~~~~~ | strncat Signed-off-by: anjiahao <anjiahao@xiaomi.com>
1 parent 1c7a7f7 commit 9c2a17a

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff --color -ur cmocka_bak/src/cmocka.c cmocka/src/cmocka.c
2+
--- cmocka_bak/src/cmocka.c 2024-11-14 15:50:02.013648944 +0800
3+
+++ cmocka/src/cmocka.c 2024-11-14 15:50:23.136212001 +0800
4+
@@ -48,6 +48,7 @@
5+
#include <regex.h>
6+
#include <mqueue.h>
7+
#include <fcntl.h>
8+
+#include <unistd.h>
9+
10+
/*
11+
* This allows to add a platform specific header file. Some embedded platforms

testing/cmocka/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ if(CONFIG_TESTING_CMOCKA)
4343
${CMAKE_CURRENT_LIST_DIR}/0005-cmocka-cmocka_private-fix-warning-in-cmocka_private.patch
4444
&& patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/cmocka <
4545
${CMAKE_CURRENT_LIST_DIR}/0006-fix-linux-risc-v-compile-error-list_initialize.patch
46+
&& patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/cmocka <
47+
${CMAKE_CURRENT_LIST_DIR}/0007-remove-nuttx-xxx.h-in-stdio-need-add-depend-header-f.patch
4648
DOWNLOAD_NO_PROGRESS true
4749
TIMEOUT 30)
4850

testing/cmocka/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ cmocka.zip:
4747
$(Q) patch -p0 < 0004-cmocka-xml-report.patch
4848
$(Q) patch -p0 < 0005-cmocka-cmocka_private-fix-warning-in-cmocka_private.patch
4949
$(Q) patch -p0 < 0006-fix-linux-risc-v-compile-error-list_initialize.patch
50+
$(Q) patch -p0 < 0007-remove-nuttx-xxx.h-in-stdio-need-add-depend-header-f.patch
5051

5152
context:: cmocka.zip
5253

0 commit comments

Comments
 (0)