Skip to content

Commit 30136f4

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 ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c:23:13: warning: implicit declaration of function ‘pthread_sigmask’ [-Wimplicit-function-declaration] 23 | if (pthread_sigmask(SIG_SETMASK, &set, NULL) != 0) { | ^~~~~~~~~~~~~~~ Signed-off-by: anjiahao <[email protected]>
1 parent 1c7a7f7 commit 30136f4

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed
Lines changed: 11 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
From 5965c3acdfa5b41ac5270314b7bd6f1d3d980827 Mon Sep 17 00:00:00 2001
2+
From: anjiahao <[email protected]>
3+
Date: Thu, 14 Nov 2024 16:10:41 +0800
4+
Subject: [PATCH] header warning fix
5+
MIME-Version: 1.0
6+
Content-Type: text/plain; charset=UTF-8
7+
Content-Transfer-Encoding: 8bit
8+
9+
ltp/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c:23:13: warning: implicit declaration of function ‘pthread_sigmask’ [-Wimplicit-function-declaration]
10+
23 | if (pthread_sigmask(SIG_SETMASK, &set, NULL) != 0) {
11+
| ^~~~~~~~~~~~~~~
12+
13+
Change-Id: I7c6553fa5e8001de8e9b560401176b277988f256
14+
Signed-off-by: anjiahao <[email protected]>
15+
---
16+
.../conformance/interfaces/pthread_sigmask/15-1.c | 1 +
17+
1 file changed, 1 insertion(+)
18+
19+
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c
20+
index d396f3be9..38444c4a1 100644
21+
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c
22+
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c
23+
@@ -12,6 +12,7 @@
24+
25+
#include <stdio.h>
26+
#include <signal.h>
27+
+#include <pthread.h>
28+
#include "posixtest.h"
29+
30+
int main(void)
31+
--
32+
2.43.0
33+

testing/ltp/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ $(LTP_UNPACK): ltp-$(LTPS_VERSION).zip
258258
$(Q) patch -d $(LTP_UNPACK) -p1 < 0010-ltp-fix-build-warning.patch
259259
$(Q) patch -d $(LTP_UNPACK) -p1 < 0011-ltp-fix-the-proc.h-header-file-duplicate-inclusion.patch
260260
$(Q) patch -d $(LTP_UNPACK) -p1 < 0012-ltp-fix-build-error.patch
261+
$(Q) patch -d $(LTP_UNPACK) -p1 < 0013-header-warning-fix.patch
261262

262263
# Download and unpack tarball if no git repo found
263264
ifeq ($(wildcard $(LTP_UNPACK)/.git),)

0 commit comments

Comments
 (0)