Skip to content

Commit

Permalink
remove <nuttx/xxx.h> in stdio need add depend header file
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
anjiahao1 committed Nov 14, 2024
1 parent 1c7a7f7 commit 30136f4
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --color -ur cmocka_bak/src/cmocka.c cmocka/src/cmocka.c
--- cmocka_bak/src/cmocka.c 2024-11-14 15:50:02.013648944 +0800
+++ cmocka/src/cmocka.c 2024-11-14 15:50:23.136212001 +0800
@@ -48,6 +48,7 @@
#include <regex.h>
#include <mqueue.h>
#include <fcntl.h>
+#include <unistd.h>

/*
* This allows to add a platform specific header file. Some embedded platforms
2 changes: 2 additions & 0 deletions testing/cmocka/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ if(CONFIG_TESTING_CMOCKA)
${CMAKE_CURRENT_LIST_DIR}/0005-cmocka-cmocka_private-fix-warning-in-cmocka_private.patch
&& patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/cmocka <
${CMAKE_CURRENT_LIST_DIR}/0006-fix-linux-risc-v-compile-error-list_initialize.patch
&& patch -p0 -d ${CMAKE_CURRENT_LIST_DIR}/cmocka <
${CMAKE_CURRENT_LIST_DIR}/0007-remove-nuttx-xxx.h-in-stdio-need-add-depend-header-f.patch
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)

Expand Down
1 change: 1 addition & 0 deletions testing/cmocka/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ cmocka.zip:
$(Q) patch -p0 < 0004-cmocka-xml-report.patch
$(Q) patch -p0 < 0005-cmocka-cmocka_private-fix-warning-in-cmocka_private.patch
$(Q) patch -p0 < 0006-fix-linux-risc-v-compile-error-list_initialize.patch
$(Q) patch -p0 < 0007-remove-nuttx-xxx.h-in-stdio-need-add-depend-header-f.patch

context:: cmocka.zip

Expand Down
33 changes: 33 additions & 0 deletions testing/ltp/0013-header-warning-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 5965c3acdfa5b41ac5270314b7bd6f1d3d980827 Mon Sep 17 00:00:00 2001
From: anjiahao <[email protected]>
Date: Thu, 14 Nov 2024 16:10:41 +0800
Subject: [PATCH] header warning fix
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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) {
| ^~~~~~~~~~~~~~~

Change-Id: I7c6553fa5e8001de8e9b560401176b277988f256
Signed-off-by: anjiahao <[email protected]>
---
.../conformance/interfaces/pthread_sigmask/15-1.c | 1 +
1 file changed, 1 insertion(+)

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
index d396f3be9..38444c4a1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c
@@ -12,6 +12,7 @@

#include <stdio.h>
#include <signal.h>
+#include <pthread.h>
#include "posixtest.h"

int main(void)
--
2.43.0

1 change: 1 addition & 0 deletions testing/ltp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ $(LTP_UNPACK): ltp-$(LTPS_VERSION).zip
$(Q) patch -d $(LTP_UNPACK) -p1 < 0010-ltp-fix-build-warning.patch
$(Q) patch -d $(LTP_UNPACK) -p1 < 0011-ltp-fix-the-proc.h-header-file-duplicate-inclusion.patch
$(Q) patch -d $(LTP_UNPACK) -p1 < 0012-ltp-fix-build-error.patch
$(Q) patch -d $(LTP_UNPACK) -p1 < 0013-header-warning-fix.patch

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

0 comments on commit 30136f4

Please sign in to comment.