You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/11 04:05:16 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #680: ltp: Resolve compile warnings

xiaoxiang781216 commented on a change in pull request #680:
URL: https://github.com/apache/incubator-nuttx-apps/pull/680#discussion_r611126660



##########
File path: testing/ltp/Makefile
##########
@@ -103,9 +119,23 @@ CFLAGS       += -I$(LTP_UNPACK)
 CFLAGS       += -I$(TESTDIR)/include
 endif
 
+# Relax warning checks to avoid expected compile errors:
+CFLAGS += -Wno-strict-prototypes -Wno-return-type -Wno-format -Wno-uninitialized
+CFLAGS += -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-value
+
+# Should be removed if possible in the future
+CFLAGS += -Wno-incompatible-pointer-types -Wno-overflow -Wno-int-to-pointer-cast
+
+# This should be defined in unistd.h
+CFLAGS += -D_POSIX_TIMEOUTS=1

Review comment:
       it's better to add this macro to nuttx repo

##########
File path: testing/ltp/0001-Fix-static-struct-warning.patch
##########
@@ -0,0 +1,39 @@
+From 0916b6a9ecac387cb2e266d76d75ff5ab3fb3440 Mon Sep 17 00:00:00 2001
+From: Brennan Ashton <ba...@brennanashton.com>
+Date: Sat, 10 Apr 2021 15:15:29 -0700
+Subject: [PATCH] Fix static struct warning
+
+---
+ .../open_posix_testsuite/conformance/interfaces/mmap/5-1.c      | 2 +-
+ testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c
+index bcb330da6..ad7b6bb2d 100644
+--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c
++++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c
+@@ -34,7 +34,7 @@
+ #include "posixtest.h"
+ #include "tempfile.h"
+ 
+-static struct testcase {
++struct testcase {
+ 	int prot;
+ 	int flags;
+ };
+diff --git a/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c b/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c
+index 14ad4ea2c..2133b721a 100644
+--- a/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c
++++ b/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c
+@@ -399,7 +399,7 @@ int main(int argc, char *argv[])
+  * The function returns 0 when r1 is the best for all cases (latency is constant) and !0 otherwise.
+  */
+ 
+-static struct row {
++struct row {

Review comment:
       let's upstream to ltp?

##########
File path: testing/ltp/Makefile
##########
@@ -103,9 +119,23 @@ CFLAGS       += -I$(LTP_UNPACK)
 CFLAGS       += -I$(TESTDIR)/include
 endif
 
+# Relax warning checks to avoid expected compile errors:
+CFLAGS += -Wno-strict-prototypes -Wno-return-type -Wno-format -Wno-uninitialized
+CFLAGS += -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-value
+
+# Should be removed if possible in the future
+CFLAGS += -Wno-incompatible-pointer-types -Wno-overflow -Wno-int-to-pointer-cast
+
+# This should be defined in unistd.h
+CFLAGS += -D_POSIX_TIMEOUTS=1
+
+# The tests use and #if instead of #ifdef for this
+CFLAGS += -D__linux__=0

Review comment:
       should we provide a patch to ltp project?

##########
File path: testing/ltp/Makefile
##########
@@ -103,9 +119,23 @@ CFLAGS       += -I$(LTP_UNPACK)
 CFLAGS       += -I$(TESTDIR)/include
 endif
 
+# Relax warning checks to avoid expected compile errors:
+CFLAGS += -Wno-strict-prototypes -Wno-return-type -Wno-format -Wno-uninitialized
+CFLAGS += -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-value
+
+# Should be removed if possible in the future
+CFLAGS += -Wno-incompatible-pointer-types -Wno-overflow -Wno-int-to-pointer-cast

Review comment:
       how about we open an issue to ltp? so ltp community may clean up the warning in the future.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org