Skip to contentSkip to conversation

Android fixes and -Werror-implicit-function-declaration as default

RFC PATCH New Petr Vorel 5 participants 16 messages Apr 11, 2019 – Aug 2, 2019 Library code

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

cover Android fixes and -Werror-implicit-function-declaration as default

Hi,

patchset [1] from Zhengwang Ruan reminded me my old patchset, which I haven't sent. Still not sure if all this hunting for 'implicitly declaring library function' make sense. Maybe it'd be better just remove -Werror-implicit-function-declaration for Android. Nevertheless this patchset fixes most (or even all) of them enable -Werror-implicit-function-declaration for all targets/platforms.

NOTE: this still don't fix Android build (with NDK compiler, outside AOSP tree), but makes it closer (now it builds at least lib/ folder).

Kind regards,
Petr

[1] http://lists.linux.it/pipermail/ltp/2019-April/011643.html

Petr Vorel (3):
cve/cve-2014-0196: Don't use libutil for Android
Add more missing <string.h> and <strings.h> includes
make: Add -Werror-implicit-function-declaration for all targets

 include/mk/env_post.mk                                      | 4 +---
 include/tst_net.h                                           | 1 +
 include/tst_numa.h                                          | 2 ++
 lib/tst_af_alg.c                                            | 1 +
 testcases/cve/Makefile                                      | 6 +++++-
 testcases/kernel/syscalls/acct/acct01.c                     | 1 +
 testcases/kernel/syscalls/add_key/add_key02.c               | 1 +
 testcases/kernel/syscalls/chmod/chmod06.c                   | 1 +
 testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c   | 1 +
 testcases/kernel/syscalls/clock_adjtime/clock_adjtime02.c   | 1 +
 .../kernel/syscalls/copy_file_range/copy_file_range01.c     | 1 +
 testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c           | 1 +
 testcases/kernel/syscalls/epoll_wait/epoll_wait01.c         | 1 +
 testcases/kernel/syscalls/execl/execl01_child.c             | 2 ++
 testcases/kernel/syscalls/execle/execle01_child.c           | 4 +++-
 testcases/kernel/syscalls/execlp/execlp01_child.c           | 2 ++
 testcases/kernel/syscalls/execv/execv01_child.c             | 2 ++
 testcases/kernel/syscalls/execve/execve01_child.c           | 4 +++-
 testcases/kernel/syscalls/execve/execve_child.c             | 4 +++-
 testcases/kernel/syscalls/execvp/execvp01_child.c           | 2 ++
 testcases/kernel/syscalls/exit/exit02.c                     | 1 +
 testcases/kernel/syscalls/getcwd/getcwd04.c                 | 1 +
 testcases/kernel/syscalls/getrandom/getrandom02.c           | 2 ++
 testcases/kernel/syscalls/ioctl/ioctl08.c                   | 1 +
 testcases/kernel/syscalls/keyctl/keyctl05.c                 | 1 +
 testcases/kernel/syscalls/keyctl/keyctl06.c                 | 1 +
 testcases/kernel/syscalls/link/link08.c                     | 1 +
 testcases/kernel/syscalls/listxattr/listxattr02.c           | 1 +
 testcases/kernel/syscalls/llistxattr/llistxattr02.c         | 1 +
 testcases/kernel/syscalls/lremovexattr/lremovexattr01.c     | 1 +
 testcases/kernel/syscalls/madvise/madvise10.c               | 1 +
 testcases/kernel/syscalls/mkdir/mkdir03.c                   | 1 +
 testcases/kernel/syscalls/read/read01.c                     | 1 +
 testcases/kernel/syscalls/request_key/request_key03.c       | 1 +
 testcases/kernel/syscalls/rmdir/rmdir02.c                   | 1 +
 testcases/kernel/syscalls/setsockopt/setsockopt03.c         | 1 +
 testcases/kernel/syscalls/write/write03.c                   | 1 +
 testcases/kernel/syscalls/writev/writev07.c                 | 1 +
 testcases/lib/tst_checkpoint.c                              | 1 +
 testcases/lib/tst_device.c                                  | 1 +
 testcases/lib/tst_kvcmp.c                                   | 1 +
 testcases/network/sctp/sctp_big_chunk.c                     | 1 +
 42 files changed, 58 insertions(+), 7 deletions(-)
Signature · 1 line
2.20.1
author
#1 lore raw

RFC PATCH 1/3 cve/cve-2014-0196: Don't use libutil for Android

From: Petr Vorel <[email protected]>

as it's not available for it.

---
 testcases/cve/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
testcases/cve/Makefile +5 -1
index 6dc401cff..da44fff60 100644
@@ -27,7 +27,11 @@ cve-2016-7117:	CFLAGS += -pthread
 cve-2016-7117:	LDLIBS += -lrt
 
 cve-2014-0196:  CFLAGS += -pthread
-cve-2014-0196:  LDLIBS += -lrt -lutil
+cve-2014-0196:  LDLIBS += -lrt
+
+ifneq ($(ANDROID),1)
+cve-2014-0196:  LDLIBS += -lutil
+endif
 
 cve-2017-2671:	CFLAGS += -pthread
 cve-2017-2671:	LDLIBS += -lrt
Signature · 1 line
2.20.1
author
#3 lore raw

RFC PATCH 1/3 cve/cve-2014-0196: Don't use libutil for Android

Hi Sandeep,

Quoted 5 lines · Petr Vorel
Quoted 3 lines

From: Petr Vorel <[email protected]>

as it's not available for it.

Quoted 8 lines
Quoted 2 lines

We've needed this for a while now and I always end up removing the libutil reference in the auto-generated gen.bp file. Thanks for fixing this Petr.

Thanks for your review, pushed this one.

Kind regards,
Petr

author
#4 lore raw

RFC PATCH 2/3 Add more missing <string.h> and <strings.h> includes

In reply to Petr Vorel

From: Petr Vorel <[email protected]>

---
Instead of this one [1] can be chosen or this can be rebased on [1] (commit after [1]). I created it few weeks ago, but didn't consider it reasonable to be added. But with next commit, which adds -Werror-implicit-function-declaration for all IMHO it makes sense.

Other users of strcmp() and friends aren't causing a failure, probably due other header including <string.h>.

Kind regards,
Petr

[1] http://lists.linux.it/pipermail/ltp/2019-April/011643.html

---
 include/tst_net.h                                             | 1 +
 include/tst_numa.h                                            | 2 ++
 lib/tst_af_alg.c                                              | 1 +
 testcases/kernel/syscalls/acct/acct01.c                       | 1 +
 testcases/kernel/syscalls/add_key/add_key02.c                 | 1 +
 testcases/kernel/syscalls/chmod/chmod06.c                     | 1 +
 testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c     | 1 +
 testcases/kernel/syscalls/clock_adjtime/clock_adjtime02.c     | 1 +
 testcases/kernel/syscalls/copy_file_range/copy_file_range01.c | 1 +
 testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c             | 1 +
 testcases/kernel/syscalls/epoll_wait/epoll_wait01.c           | 1 +
 testcases/kernel/syscalls/execl/execl01_child.c               | 2 ++
 testcases/kernel/syscalls/execle/execle01_child.c             | 4 +++-
 testcases/kernel/syscalls/execlp/execlp01_child.c             | 2 ++
 testcases/kernel/syscalls/execv/execv01_child.c               | 2 ++
 testcases/kernel/syscalls/execve/execve01_child.c             | 4 +++-
 testcases/kernel/syscalls/execve/execve_child.c               | 4 +++-
 testcases/kernel/syscalls/execvp/execvp01_child.c             | 2 ++
 testcases/kernel/syscalls/exit/exit02.c                       | 1 +
 testcases/kernel/syscalls/getcwd/getcwd04.c                   | 1 +
 testcases/kernel/syscalls/getrandom/getrandom02.c             | 2 ++
 testcases/kernel/syscalls/ioctl/ioctl08.c                     | 1 +
 testcases/kernel/syscalls/keyctl/keyctl05.c                   | 1 +
 testcases/kernel/syscalls/keyctl/keyctl06.c                   | 1 +
 testcases/kernel/syscalls/link/link08.c                       | 1 +
 testcases/kernel/syscalls/listxattr/listxattr02.c             | 1 +
 testcases/kernel/syscalls/llistxattr/llistxattr02.c           | 1 +
 testcases/kernel/syscalls/lremovexattr/lremovexattr01.c       | 1 +
 testcases/kernel/syscalls/madvise/madvise10.c                 | 1 +
 testcases/kernel/syscalls/mkdir/mkdir03.c                     | 1 +
 testcases/kernel/syscalls/read/read01.c                       | 1 +
 testcases/kernel/syscalls/request_key/request_key03.c         | 1 +
 testcases/kernel/syscalls/rmdir/rmdir02.c                     | 1 +
 testcases/kernel/syscalls/setsockopt/setsockopt03.c           | 1 +
 testcases/kernel/syscalls/write/write03.c                     | 1 +
 testcases/kernel/syscalls/writev/writev07.c                   | 1 +
 testcases/lib/tst_checkpoint.c                                | 1 +
 testcases/lib/tst_device.c                                    | 1 +
 testcases/lib/tst_kvcmp.c                                     | 1 +
 testcases/network/sctp/sctp_big_chunk.c                       | 1 +
 40 files changed, 52 insertions(+), 3 deletions(-)
include/tst_net.h +1 -0
index cb97b7b61..971d5ec2c 100644
@@ -17,6 +17,7 @@
 
 #include <arpa/inet.h>
 #include <errno.h>
+#include <string.h>
 
 #define MAX_IPV4_PREFIX 32
 #define MAX_IPV6_PREFIX 128
include/tst_numa.h +2 -0
index a4cd1be37..4f9806602 100644
@@ -7,6 +7,8 @@
 #ifndef TST_NUMA_H__
 #define TST_NUMA_H__
 
+#include <string.h>
+
 /**
  * Numa nodemap.
  */
lib/tst_af_alg.c +1 -0
index 97be548b4..edf8c0140 100644
@@ -5,6 +5,7 @@
 
 #include <errno.h>
 #include <stdlib.h>
+#include <string.h>
 
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
testcases/kernel/syscalls/acct/acct01.c +1 -0
index f58e02584..40316db2e 100644
@@ -14,6 +14,7 @@
 #include <pwd.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <sys/mount.h>
 
testcases/kernel/syscalls/add_key/add_key02.c +1 -0
index 6d19ff2d8..85bd7b150 100644
@@ -35,6 +35,7 @@
  */
 
 #include <errno.h>
+#include <string.h>
 
 #include "tst_test.h"
 #include "lapi/keyctl.h"
testcases/kernel/syscalls/chmod/chmod06.c +1 -0
index e5bb58fc5..468c7b33d 100644
@@ -39,6 +39,7 @@
  */
 #include <pwd.h>
 #include <errno.h>
+#include <string.h>
 #include "tst_test.h"
 
 #define MODE_RWX	(S_IRWXU|S_IRWXG|S_IRWXO)
testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c +1 -0
index 6eac1f25c..b48703101 100644
@@ -54,6 +54,7 @@
  *      ro  STA_CLK - clock source. unused.
  */
 
+#include <string.h>
 #include "clock_adjtime.h"
 
 static long hz;
testcases/kernel/syscalls/clock_adjtime/clock_adjtime02.c +1 -0
index 1ce936f96..e73bc8943 100644
@@ -55,6 +55,7 @@
  *      ro  STA_CLK - clock source. unused.
  */
 
+#include <string.h>
 #include "clock_adjtime.h"
 
 static long hz;
testcases/kernel/syscalls/copy_file_range/copy_file_range01.c +1 -0
index 2bca8a403..61a6042d9 100644
@@ -15,6 +15,7 @@
 #define _GNU_SOURCE
 #include <stdio.h>
 #include <errno.h>
+#include <stdlib.h>
 #include "tst_test.h"
 #include "tst_safe_stdio.h"
 #include "lapi/syscalls.h"
testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c +1 -0
index e837913fb..4be106bc6 100644
@@ -32,6 +32,7 @@
 #include <sys/epoll.h>
 #include <poll.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 #include "tst_test.h"
 
testcases/kernel/syscalls/epoll_wait/epoll_wait01.c +1 -0
index 0ded12765..6099b84aa 100644
@@ -26,6 +26,7 @@
 #include <sys/epoll.h>
 #include <poll.h>
 #include <string.h>
+#include <strings.h>
 #include <errno.h>
 
 #include "tst_test.h"
testcases/kernel/syscalls/execl/execl01_child.c +2 -0
index 8a6e5123f..84f34428d 100644
@@ -16,6 +16,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <string.h>
+
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 
testcases/kernel/syscalls/execle/execle01_child.c +3 -1
index 0ebfaa876..315c8afbf 100644
@@ -16,8 +16,10 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define TST_NO_DEFAULT_MAIN
 #include <stdlib.h>
+#include <string.h>
+
+#define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 
 int main(int argc, char *argv[])
testcases/kernel/syscalls/execlp/execlp01_child.c +2 -0
index 8a6e5123f..84f34428d 100644
@@ -16,6 +16,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <string.h>
+
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 
testcases/kernel/syscalls/execv/execv01_child.c +2 -0
index 307810c63..8272df67b 100644
@@ -20,6 +20,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <string.h>
+
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 
testcases/kernel/syscalls/execve/execve01_child.c +3 -1
index 0ebfaa876..315c8afbf 100644
@@ -16,8 +16,10 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#define TST_NO_DEFAULT_MAIN
 #include <stdlib.h>
+#include <string.h>
+
+#define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 
 int main(int argc, char *argv[])
testcases/kernel/syscalls/execve/execve_child.c +3 -1
index bcf8ccc69..0402ee325 100644
@@ -21,8 +21,10 @@
  *	dummy program which is used by execve02/4/5.c testcase
  */
 
-#define TST_NO_DEFAULT_MAIN
 #include <stdlib.h>
+#include <string.h>
+
+#define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 
 int main(int argc, char *argv[])
testcases/kernel/syscalls/execvp/execvp01_child.c +2 -0
index 8a6e5123f..84f34428d 100644
@@ -16,6 +16,8 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <string.h>
+
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 
testcases/kernel/syscalls/exit/exit02.c +1 -0
index fa9639704..69132e973 100644
@@ -25,6 +25,7 @@
  */
 
 #include <stdlib.h>
+#include <string.h>
 #include "tst_test.h"
 
 #define FNAME "test_file"
testcases/kernel/syscalls/getcwd/getcwd04.c +1 -0
index ba8c358f6..fd8524bb4 100644
@@ -37,6 +37,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <string.h>
 #include "tst_test.h"
 
 #define TIMEOUT	5
testcases/kernel/syscalls/getrandom/getrandom02.c +2 -0
index e7d03e799..bb4908c92 100644
@@ -27,6 +27,8 @@
  *
  */
 
+#include <string.h>
+
 #include "lapi/getrandom.h"
 #include "lapi/syscalls.h"
 #include "tst_test.h"
testcases/kernel/syscalls/ioctl/ioctl08.c +1 -0
index 8de80048c..2c01749ae 100644
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <sys/ioctl.h>
 #include <errno.h>
+#include <string.h>
 #include "tst_test.h"
 
 #ifdef HAVE_STRUCT_FILE_DEDUPE_RANGE
testcases/kernel/syscalls/keyctl/keyctl05.c +1 -0
index e2ed8ad48..1bf9066db 100644
@@ -39,6 +39,7 @@
 
 #include <errno.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "tst_test.h"
 #include "lapi/keyctl.h"
testcases/kernel/syscalls/keyctl/keyctl06.c +1 -0
index bab26ee5c..cf95e2b80 100644
@@ -29,6 +29,7 @@
  */
 
 #include <errno.h>
+#include <string.h>
 
 #include "tst_test.h"
 #include "lapi/keyctl.h"
testcases/kernel/syscalls/link/link08.c +1 -0
index 775c0c27b..be3872d64 100644
@@ -32,6 +32,7 @@
  *      if too many symbolic links were encountered in resolving path.
  */
 #include <errno.h>
+#include <string.h>
 #include "tst_test.h"
 
 #define DIR_MODE	(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
testcases/kernel/syscalls/listxattr/listxattr02.c +1 -0
index 33f57d567..b512e10b7 100644
@@ -35,6 +35,7 @@
 
 #include "config.h"
 #include <errno.h>
+#include <string.h>
 #include <sys/types.h>
 
 #ifdef HAVE_SYS_XATTR_H
testcases/kernel/syscalls/llistxattr/llistxattr02.c +1 -0
index d239e97bf..c444bae0b 100644
@@ -33,6 +33,7 @@
 
 #include "config.h"
 #include <errno.h>
+#include <string.h>
 #include <sys/types.h>
 
 #ifdef HAVE_SYS_XATTR_H
testcases/kernel/syscalls/lremovexattr/lremovexattr01.c +1 -0
index 26194f114..38cb6d6be 100644
@@ -26,6 +26,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <unistd.h>
 #include <fcntl.h>
 
testcases/kernel/syscalls/madvise/madvise10.c +1 -0
index ca0b9f39b..e0099fc73 100644
@@ -54,6 +54,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include "lapi/mmap.h"
 #include "tst_test.h"
testcases/kernel/syscalls/mkdir/mkdir03.c +1 -0
index 8cadf9c21..74d39c466 100644
@@ -28,6 +28,7 @@
 #include <sys/mman.h>
 #include <fcntl.h>
 #include <sys/mount.h>
+#include <string.h>
 
 #include "tst_test.h"
 
testcases/kernel/syscalls/read/read01.c +1 -0
index 68aea0917..798e67b95 100644
@@ -32,6 +32,7 @@
  */
 
 #include <errno.h>
+#include <string.h>
 #include "tst_test.h"
 
 #define SIZE 512
testcases/kernel/syscalls/request_key/request_key03.c +1 -0
index 9996a6f87..50d024e2e 100644
@@ -44,6 +44,7 @@
 #include <errno.h>
 #include <stdbool.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/wait.h>
 
 #include "tst_test.h"
testcases/kernel/syscalls/rmdir/rmdir02.c +1 -0
index 3f3669213..6f4fa405a 100644
@@ -28,6 +28,7 @@
  */
 
 #include <errno.h>
+#include <string.h>
 
 #include "tst_test.h"
 
testcases/kernel/syscalls/setsockopt/setsockopt03.c +1 -0
index 2d99865b7..42952e98d 100644
@@ -28,6 +28,7 @@
  */
 
 #include <stdint.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
testcases/kernel/syscalls/write/write03.c +1 -0
index 7e3ec98df..61480c306 100644
@@ -31,6 +31,7 @@
  */
 
 #include <stdio.h>
+#include <string.h>
 #include <errno.h>
 #include "tst_test.h"
 
testcases/kernel/syscalls/writev/writev07.c +1 -0
index ec883ed15..c7d03dae0 100644
@@ -32,6 +32,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
+#include <string.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/types.h>
testcases/lib/tst_checkpoint.c +1 -0
index 57c7bc1bb..fd18c146d 100644
@@ -20,6 +20,7 @@
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 
testcases/lib/tst_device.c +1 -0
index 1cfdc962c..73d2e7dcb 100644
@@ -20,6 +20,7 @@
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
 #include "old/old_device.h"
testcases/lib/tst_kvcmp.c +1 -0
index 06632a278..0405d9d9e 100644
@@ -19,6 +19,7 @@
 #define TST_NO_DEFAULT_MAIN
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/utsname.h>
 #include <tst_test.h>
 
testcases/network/sctp/sctp_big_chunk.c +1 -0
index 4ebdcb20f..32c350af2 100644
@@ -14,6 +14,7 @@
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
 #include <netdb.h>
+#include <string.h>
 #include <sys/syscall.h>
 
 #include "tst_test.h"
Signature · 1 line
2.20.1
#5 lore raw

RFC PATCH 2/3 Add more missing <string.h> and <strings.h> includes

Hi Petr,

-------- Original Message --------
From: Petr Vorel
Sent: Fri, 12 Apr 2019 01:31:14 +0200
To: Ltp
Cc: Petr Vorel, Sandeep Patil, Steve Muckle, Zhengwang Ruan, Cyril Hrubis, Petr Vorel
Subject: [RFC PATCH 2/3] Add more missing <string.h> and <strings.h> includes

Quoted 90 lines

From: Petr Vorel <[email protected]>

---
Instead of this one [1] can be chosen or this can be rebased on [1] (commit after [1]). I created it few weeks ago, but didn't consider it reasonable to be added. But with next commit, which adds -Werror-implicit-function-declaration for all IMHO it makes sense.

Other users of strcmp() and friends aren't causing a failure, probably due other header including <string.h>.

Kind regards,
Petr

[1] http://lists.linux.it/pipermail/ltp/2019-April/011643.html

---
  include/tst_net.h                                             | 1 +
  include/tst_numa.h                                            | 2 ++
  lib/tst_af_alg.c                                              | 1 +
  testcases/kernel/syscalls/acct/acct01.c                       | 1 +
  testcases/kernel/syscalls/add_key/add_key02.c                 | 1 +
  testcases/kernel/syscalls/chmod/chmod06.c                     | 1 +
  testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c     | 1 +
  testcases/kernel/syscalls/clock_adjtime/clock_adjtime02.c     | 1 +
  testcases/kernel/syscalls/copy_file_range/copy_file_range01.c | 1 +
  testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c             | 1 +
  testcases/kernel/syscalls/epoll_wait/epoll_wait01.c           | 1 +
  testcases/kernel/syscalls/execl/execl01_child.c               | 2 ++
  testcases/kernel/syscalls/execle/execle01_child.c             | 4 +++-
  testcases/kernel/syscalls/execlp/execlp01_child.c             | 2 ++
  testcases/kernel/syscalls/execv/execv01_child.c               | 2 ++
  testcases/kernel/syscalls/execve/execve01_child.c             | 4 +++-
  testcases/kernel/syscalls/execve/execve_child.c               | 4 +++-
  testcases/kernel/syscalls/execvp/execvp01_child.c             | 2 ++
  testcases/kernel/syscalls/exit/exit02.c                       | 1 +
  testcases/kernel/syscalls/getcwd/getcwd04.c                   | 1 +
  testcases/kernel/syscalls/getrandom/getrandom02.c             | 2 ++
  testcases/kernel/syscalls/ioctl/ioctl08.c                     | 1 +
  testcases/kernel/syscalls/keyctl/keyctl05.c                   | 1 +
  testcases/kernel/syscalls/keyctl/keyctl06.c                   | 1 +
  testcases/kernel/syscalls/link/link08.c                       | 1 +
  testcases/kernel/syscalls/listxattr/listxattr02.c             | 1 +
  testcases/kernel/syscalls/llistxattr/llistxattr02.c           | 1 +
  testcases/kernel/syscalls/lremovexattr/lremovexattr01.c       | 1 +
  testcases/kernel/syscalls/madvise/madvise10.c                 | 1 +
  testcases/kernel/syscalls/mkdir/mkdir03.c                     | 1 +
  testcases/kernel/syscalls/read/read01.c                       | 1 +
  testcases/kernel/syscalls/request_key/request_key03.c         | 1 +
  testcases/kernel/syscalls/rmdir/rmdir02.c                     | 1 +
  testcases/kernel/syscalls/setsockopt/setsockopt03.c           | 1 +
  testcases/kernel/syscalls/write/write03.c                     | 1 +
  testcases/kernel/syscalls/writev/writev07.c                   | 1 +
  testcases/lib/tst_checkpoint.c                                | 1 +
  testcases/lib/tst_device.c                                    | 1 +
  testcases/lib/tst_kvcmp.c                                     | 1 +
  testcases/network/sctp/sctp_big_chunk.c                       | 1 +
  40 files changed, 52 insertions(+), 3 deletions(-)
include/tst_net.h +1 -0
index cb97b7b61..971d5ec2c 100644
@@ -17,6 +17,7 @@
 
  #include <arpa/inet.h>
  #include <errno.h>
+#include <string.h>
 
  #define MAX_IPV4_PREFIX 32
  #define MAX_IPV6_PREFIX 128
include/tst_numa.h +2 -0
index a4cd1be37..4f9806602 100644
@@ -7,6 +7,8 @@
  #ifndef TST_NUMA_H__
  #define TST_NUMA_H__
 
+#include <string.h>
+
  /**
   * Numa nodemap.
   */
lib/tst_af_alg.c +0 -0
index 97be548b4..edf8c0140 100644

lib/tst_af_alg.c line 8

Quoted 4 lines
lib/tst_af_alg.c +1 -0
@@ -5,6 +5,7 @@
 
  #include <errno.h>
  #include <stdlib.h>
+#include <string.h>

Why not simply include <string.h>  in tst_test.h. I did it in my another review thread. This should be OK for most of cases.

Regards,

Zhengwang

Quoted 457 lines
lib/tst_af_alg.c +0 -0
  #define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
testcases/kernel/syscalls/acct/acct01.c +1 -0
index f58e02584..40316db2e 100644
@@ -14,6 +14,7 @@
  #include <pwd.h>
  #include <stdio.h>
  #include <stdlib.h>
+#include <string.h>
  #include <unistd.h>
  #include <sys/mount.h>
 
testcases/kernel/syscalls/add_key/add_key02.c +1 -0
index 6d19ff2d8..85bd7b150 100644
@@ -35,6 +35,7 @@
   */
 
  #include <errno.h>
+#include <string.h>
 
  #include "tst_test.h"
  #include "lapi/keyctl.h"
testcases/kernel/syscalls/chmod/chmod06.c +1 -0
index e5bb58fc5..468c7b33d 100644
@@ -39,6 +39,7 @@
   */
  #include <pwd.h>
  #include <errno.h>
+#include <string.h>
  #include "tst_test.h"
 
  #define MODE_RWX	(S_IRWXU|S_IRWXG|S_IRWXO)
testcases/kernel/syscalls/clock_adjtime/clock_adjtime01.c +1 -0
index 6eac1f25c..b48703101 100644
@@ -54,6 +54,7 @@
   *      ro  STA_CLK - clock source. unused.
   */
 
+#include <string.h>
  #include "clock_adjtime.h"
 
  static long hz;
testcases/kernel/syscalls/clock_adjtime/clock_adjtime02.c +1 -0
index 1ce936f96..e73bc8943 100644
@@ -55,6 +55,7 @@
   *      ro  STA_CLK - clock source. unused.
   */
 
+#include <string.h>
  #include "clock_adjtime.h"
 
  static long hz;
testcases/kernel/syscalls/copy_file_range/copy_file_range01.c +1 -0
index 2bca8a403..61a6042d9 100644
@@ -15,6 +15,7 @@
  #define _GNU_SOURCE
  #include <stdio.h>
  #include <errno.h>
+#include <stdlib.h>
  #include "tst_test.h"
  #include "tst_safe_stdio.h"
  #include "lapi/syscalls.h"
testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c +1 -0
index e837913fb..4be106bc6 100644
@@ -32,6 +32,7 @@
  #include <sys/epoll.h>
  #include <poll.h>
  #include <string.h>
+#include <strings.h>
  #include <errno.h>
  #include "tst_test.h"
 
testcases/kernel/syscalls/epoll_wait/epoll_wait01.c +1 -0
index 0ded12765..6099b84aa 100644
@@ -26,6 +26,7 @@
  #include <sys/epoll.h>
  #include <poll.h>
  #include <string.h>
+#include <strings.h>
  #include <errno.h>
 
  #include "tst_test.h"
testcases/kernel/syscalls/execl/execl01_child.c +2 -0
index 8a6e5123f..84f34428d 100644
@@ -16,6 +16,8 @@
   * along with this program. If not, see <http://www.gnu.org/licenses/>.
   */
 
+#include <string.h>
+
  #define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
 
testcases/kernel/syscalls/execle/execle01_child.c +3 -1
index 0ebfaa876..315c8afbf 100644
@@ -16,8 +16,10 @@
   * along with this program. If not, see <http://www.gnu.org/licenses/>.
   */
 
-#define TST_NO_DEFAULT_MAIN
  #include <stdlib.h>
+#include <string.h>
+
+#define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
 
  int main(int argc, char *argv[])
testcases/kernel/syscalls/execlp/execlp01_child.c +2 -0
index 8a6e5123f..84f34428d 100644
@@ -16,6 +16,8 @@
   * along with this program. If not, see <http://www.gnu.org/licenses/>.
   */
 
+#include <string.h>
+
  #define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
 
testcases/kernel/syscalls/execv/execv01_child.c +2 -0
index 307810c63..8272df67b 100644
@@ -20,6 +20,8 @@
   * along with this program. If not, see <http://www.gnu.org/licenses/>.
   */
 
+#include <string.h>
+
  #define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
 
testcases/kernel/syscalls/execve/execve01_child.c +3 -1
index 0ebfaa876..315c8afbf 100644
@@ -16,8 +16,10 @@
   * along with this program. If not, see <http://www.gnu.org/licenses/>.
   */
 
-#define TST_NO_DEFAULT_MAIN
  #include <stdlib.h>
+#include <string.h>
+
+#define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
 
  int main(int argc, char *argv[])
testcases/kernel/syscalls/execve/execve_child.c +3 -1
index bcf8ccc69..0402ee325 100644
@@ -21,8 +21,10 @@
   *	dummy program which is used by execve02/4/5.c testcase
   */
 
-#define TST_NO_DEFAULT_MAIN
  #include <stdlib.h>
+#include <string.h>
+
+#define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
 
  int main(int argc, char *argv[])
testcases/kernel/syscalls/execvp/execvp01_child.c +2 -0
index 8a6e5123f..84f34428d 100644
@@ -16,6 +16,8 @@
   * along with this program. If not, see <http://www.gnu.org/licenses/>.
   */
 
+#include <string.h>
+
  #define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
 
testcases/kernel/syscalls/exit/exit02.c +1 -0
index fa9639704..69132e973 100644
@@ -25,6 +25,7 @@
   */
 
  #include <stdlib.h>
+#include <string.h>
  #include "tst_test.h"
 
  #define FNAME "test_file"
testcases/kernel/syscalls/getcwd/getcwd04.c +1 -0
index ba8c358f6..fd8524bb4 100644
@@ -37,6 +37,7 @@
  #include <fcntl.h>
  #include <sys/types.h>
  #include <unistd.h>
+#include <string.h>
  #include "tst_test.h"
 
  #define TIMEOUT	5
testcases/kernel/syscalls/getrandom/getrandom02.c +2 -0
index e7d03e799..bb4908c92 100644
@@ -27,6 +27,8 @@
   *
   */
 
+#include <string.h>
+
  #include "lapi/getrandom.h"
  #include "lapi/syscalls.h"
  #include "tst_test.h"
testcases/kernel/syscalls/ioctl/ioctl08.c +1 -0
index 8de80048c..2c01749ae 100644
@@ -20,6 +20,7 @@
  #include <stdlib.h>
  #include <sys/ioctl.h>
  #include <errno.h>
+#include <string.h>
  #include "tst_test.h"
 
  #ifdef HAVE_STRUCT_FILE_DEDUPE_RANGE
testcases/kernel/syscalls/keyctl/keyctl05.c +1 -0
index e2ed8ad48..1bf9066db 100644
@@ -39,6 +39,7 @@
 
  #include <errno.h>
  #include <stdlib.h>
+#include <string.h>
 
  #include "tst_test.h"
  #include "lapi/keyctl.h"
testcases/kernel/syscalls/keyctl/keyctl06.c +1 -0
index bab26ee5c..cf95e2b80 100644
@@ -29,6 +29,7 @@
   */
 
  #include <errno.h>
+#include <string.h>
 
  #include "tst_test.h"
  #include "lapi/keyctl.h"
testcases/kernel/syscalls/link/link08.c +1 -0
index 775c0c27b..be3872d64 100644
@@ -32,6 +32,7 @@
   *      if too many symbolic links were encountered in resolving path.
   */
  #include <errno.h>
+#include <string.h>
  #include "tst_test.h"
 
  #define DIR_MODE	(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
testcases/kernel/syscalls/listxattr/listxattr02.c +1 -0
index 33f57d567..b512e10b7 100644
@@ -35,6 +35,7 @@
 
  #include "config.h"
  #include <errno.h>
+#include <string.h>
  #include <sys/types.h>
 
  #ifdef HAVE_SYS_XATTR_H
testcases/kernel/syscalls/llistxattr/llistxattr02.c +1 -0
index d239e97bf..c444bae0b 100644
@@ -33,6 +33,7 @@
 
  #include "config.h"
  #include <errno.h>
+#include <string.h>
  #include <sys/types.h>
 
  #ifdef HAVE_SYS_XATTR_H
testcases/kernel/syscalls/lremovexattr/lremovexattr01.c +1 -0
index 26194f114..38cb6d6be 100644
@@ -26,6 +26,7 @@
  #include <errno.h>
  #include <stdlib.h>
  #include <stdio.h>
+#include <string.h>
  #include <unistd.h>
  #include <fcntl.h>
 
testcases/kernel/syscalls/madvise/madvise10.c +1 -0
index ca0b9f39b..e0099fc73 100644
@@ -54,6 +54,7 @@
  #include <errno.h>
  #include <unistd.h>
  #include <stdlib.h>
+#include <string.h>
 
  #include "lapi/mmap.h"
  #include "tst_test.h"
testcases/kernel/syscalls/mkdir/mkdir03.c +1 -0
index 8cadf9c21..74d39c466 100644
@@ -28,6 +28,7 @@
  #include <sys/mman.h>
  #include <fcntl.h>
  #include <sys/mount.h>
+#include <string.h>
 
  #include "tst_test.h"
 
testcases/kernel/syscalls/read/read01.c +1 -0
index 68aea0917..798e67b95 100644
@@ -32,6 +32,7 @@
   */
 
  #include <errno.h>
+#include <string.h>
  #include "tst_test.h"
 
  #define SIZE 512
testcases/kernel/syscalls/request_key/request_key03.c +1 -0
index 9996a6f87..50d024e2e 100644
@@ -44,6 +44,7 @@
  #include <errno.h>
  #include <stdbool.h>
  #include <stdlib.h>
+#include <string.h>
  #include <sys/wait.h>
 
  #include "tst_test.h"
testcases/kernel/syscalls/rmdir/rmdir02.c +1 -0
index 3f3669213..6f4fa405a 100644
@@ -28,6 +28,7 @@
   */
 
  #include <errno.h>
+#include <string.h>
 
  #include "tst_test.h"
 
testcases/kernel/syscalls/setsockopt/setsockopt03.c +1 -0
index 2d99865b7..42952e98d 100644
@@ -28,6 +28,7 @@
   */
 
  #include <stdint.h>
+#include <string.h>
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <netinet/in.h>
testcases/kernel/syscalls/write/write03.c +1 -0
index 7e3ec98df..61480c306 100644
@@ -31,6 +31,7 @@
   */
 
  #include <stdio.h>
+#include <string.h>
  #include <errno.h>
  #include "tst_test.h"
 
testcases/kernel/syscalls/writev/writev07.c +1 -0
index ec883ed15..c7d03dae0 100644
@@ -32,6 +32,7 @@
  #include <errno.h>
  #include <fcntl.h>
  #include <stdio.h>
+#include <string.h>
  #include <sys/mman.h>
  #include <sys/stat.h>
  #include <sys/types.h>
testcases/lib/tst_checkpoint.c +1 -0
index 57c7bc1bb..fd18c146d 100644
@@ -20,6 +20,7 @@
  #include <limits.h>
  #include <stdio.h>
  #include <stdlib.h>
+#include <string.h>
  #define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
 
testcases/lib/tst_device.c +1 -0
index 1cfdc962c..73d2e7dcb 100644
@@ -20,6 +20,7 @@
  #include <limits.h>
  #include <stdio.h>
  #include <stdlib.h>
+#include <string.h>
  #define TST_NO_DEFAULT_MAIN
  #include "tst_test.h"
  #include "old/old_device.h"
testcases/lib/tst_kvcmp.c +1 -0
index 06632a278..0405d9d9e 100644
@@ -19,6 +19,7 @@
  #define TST_NO_DEFAULT_MAIN
  #include <stdio.h>
  #include <stdlib.h>
+#include <string.h>
  #include <sys/utsname.h>
  #include <tst_test.h>
 
testcases/network/sctp/sctp_big_chunk.c +0 -0
index 4ebdcb20f..32c350af2 100644

testcases/network/sctp/sctp_big_chunk.c line 20

Quoted 7 lines
testcases/network/sctp/sctp_big_chunk.c +1 -0
@@ -14,6 +14,7 @@
  #include <netinet/ip.h>
  #include <netinet/ip6.h>
  #include <netdb.h>
+#include <string.h>
  #include <sys/syscall.h>
 
  #include "tst_test.h"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190412/511c8ca0/attachment-0001.html>

#6 lore raw

RFC PATCH 2/3 Add more missing <string.h> and <strings.h> includes

Hi!

Quoted 19 lines
Quoted 19 lines
include/tst_numa.h +2 -0
index a4cd1be37..4f9806602 100644
@@ -7,6 +7,8 @@
  #ifndef TST_NUMA_H__
  #define TST_NUMA_H__
 
+#include <string.h>
+
  /**
   * Numa nodemap.
   */
lib/tst_af_alg.c +0 -0
index 97be548b4..edf8c0140 100644
@@ -5,6 +5,7 @@
 
Quoted 6 lines

lib/tst_af_alg.c line 8

Quoted 3 lines
lib/tst_af_alg.c +1 -0
  #include <errno.h>
  #include <stdlib.h>
+#include <string.h>

Why not simply include <string.h>?? in tst_test.h. I did it in my another review thread. This should be OK for most of cases.

Sounds reasonable to me.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#7 lore raw

RFC PATCH 2/3 Add more missing <string.h> and <strings.h> includes

Hi,

Quoted 19 lines
Quoted 18 lines
Quoted 18 lines
include/tst_numa.h +2 -0
index a4cd1be37..4f9806602 100644
@@ -7,6 +7,8 @@
  #ifndef TST_NUMA_H__
  #define TST_NUMA_H__
 
+#include <string.h>
+
  /**
   * Numa nodemap.
   */
lib/tst_af_alg.c +0 -0
index 97be548b4..edf8c0140 100644
@@ -5,6 +5,7 @@
Quoted 8 lines
Quoted 6 lines

lib/tst_af_alg.c line 8

Quoted 3 lines
lib/tst_af_alg.c +1 -0
  #include <errno.h>
  #include <stdlib.h>
+#include <string.h>

Why not simply include <string.h>?? in tst_test.h. I did it in my another review thread. This should be OK for most of cases.

Sounds reasonable to me.

Agree, that'd be the easiest way :). NOTE: not sure what requires that, but sometimes is <strings.h> needed as well.

Kind regards,
Petr

#8 lore raw

RFC PATCH 2/3 Add more missing <string.h> and <strings.h> includes

Hi Petr,

-------- Original Message --------
From: Petr Vorel
Sent: Fri, 12 Apr 2019 10:48:53 +0200
To: Cyril Hrubis
Cc: ?????????, Ltp, Petr Vorel, Sandeep Patil, Steve Muckle Subject: Re: [RFC PATCH 2/3] Add more missing <string.h> and <strings.h> includes

Quoted 24 lines

Hi,

Quoted 22 lines
Quoted 22 lines
Quoted 17 lines
include/tst_numa.h +2 -0
index a4cd1be37..4f9806602 100644
@@ -7,6 +7,8 @@
   #ifndef TST_NUMA_H__
   #define TST_NUMA_H__
+#include <string.h>
+
   /**
    * Numa nodemap.
    */
lib/tst_af_alg.c +0 -0
index 97be548b4..edf8c0140 100644

lib/tst_af_alg.c line 7

Quoted 3 lines
lib/tst_af_alg.c +1 -0
@@ -5,6 +5,7 @@
   #include <errno.h>
   #include <stdlib.h>
+#include <string.h>

Why not simply include <string.h>?? in tst_test.h. I did it in my another review thread. This should be OK for most of cases.

Quoted 3 lines
Quoted 1 line

Sounds reasonable to me.

Agree, that'd be the easiest way :). NOTE: not sure what requires that, but sometimes is <strings.h> needed as well.

As I know, calls likes str*, mem*, such as, strncpy, memset, requires <string.h>,  but bzero requires <strings.h>. Fortunately <strings.h> are not used as often as <string.h>. See my another review thread. :-)

Regards,

Zhengwang

Quoted 4 lines

Kind regards,
Petr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190412/862efbad/attachment.html>

#9 lore raw

RFC PATCH 2/3 Add more missing <string.h> and <strings.h> includes

Hi!

Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 17 lines
include/tst_numa.h +2 -0
index a4cd1be37..4f9806602 100644
@@ -7,6 +7,8 @@
   #ifndef TST_NUMA_H__
   #define TST_NUMA_H__
+#include <string.h>
+
   /**
    * Numa nodemap.
    */
lib/tst_af_alg.c +0 -0
index 97be548b4..edf8c0140 100644

lib/tst_af_alg.c line 7

Quoted 3 lines
lib/tst_af_alg.c +1 -0
@@ -5,6 +5,7 @@
   #include <errno.h>
   #include <stdlib.h>
+#include <string.h>

Why not simply include <string.h>?? in tst_test.h. I did it in my another review thread. This should be OK for most of cases.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Sounds reasonable to me.

Agree, that'd be the easiest way :). NOTE: not sure what requires that, but sometimes is <strings.h> needed as well.

As I know, calls likes str*, mem*, such as, strncpy, memset, requires <string.h>,?? but bzero requires <strings.h>. Fortunately <strings.h> are not used as often as <string.h>. See my another review thread. :-)

bzero() has been deprecated for quite some time, ideally we should replace it with memset().

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#10 lore raw

RFC PATCH 2/3 Add more missing <string.h> and <strings.h> includes

Hi Cyril, Zhengwang,

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Agree, that'd be the easiest way :). NOTE: not sure what requires that, but sometimes is <strings.h> needed as well.

As I know, calls likes str*, mem*, such as, strncpy, memset, requires <string.h>,?? but bzero requires <strings.h>. Fortunately <strings.h> are not used as often as <string.h>. See my another review thread. :-)

bzero() has been deprecated for quite some time, ideally we should replace it with memset().

That explains, why <strings.h> is not much used nowadays.

Kind regards,
Petr

#11 lore raw

RFC PATCH 2/3 Add more missing <string.h> and <strings.h> includes

In reply to 阮正旺
Quoted 36 lines · 阮正旺

Hi Petr,

-------- Original Message --------
From: Petr Vorel
Sent: Fri, 12 Apr 2019 10:48:53 +0200
To: Cyril Hrubis
Cc: ?????????, Ltp, Petr Vorel, Sandeep Patil, Steve Muckle
Subject: Re: [RFC PATCH 2/3] Add more missing <string.h> and <strings.h> includes

Quoted 24 lines

Hi,

Quoted 22 lines
Quoted 22 lines
Quoted 17 lines
include/tst_numa.h +2 -0
index a4cd1be37..4f9806602 100644
@@ -7,6 +7,8 @@
  #ifndef TST_NUMA_H__
  #define TST_NUMA_H__
+#include <string.h>
+
  /**
   * Numa nodemap.
   */
lib/tst_af_alg.c +0 -0
index 97be548b4..edf8c0140 100644

lib/tst_af_alg.c line 7

Quoted 3 lines
lib/tst_af_alg.c +1 -0
@@ -5,6 +5,7 @@
  #include <errno.h>
  #include <stdlib.h>
+#include <string.h>

Why not simply include <string.h>?? in tst_test.h. I did it in my another review thread. This should be OK for most of cases.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Sounds reasonable to me.

Agree, that'd be the easiest way :). NOTE: not sure what requires that, but sometimes is <strings.h> needed as well.

As I know, calls likes str*, mem*, such as, strncpy, memset, requires <string.h>, but bzero requires <strings.h>. Fortunately <strings.h> are not used as often as <string.h>. See my another review thread. :-)

(Looking at the header on FreeBSD) In addition to bzero, there are other deprecated functions like bcmp, bcopy, but also lesser used functions like strcasecmp and strncasecmp which are defined in strings.h . Cheers,
-Enji
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190412/d32f4998/attachment.html>

author
#12 lore raw

RFC PATCH 3/3 make: Add -Werror-implicit-function-declaration for all targets

In reply to Petr Vorel

Previously it was passed only to Android build, but it's good to check it for all.

---
Tested in travis:
https://travis-ci.org/pevik/ltp/builds/518886113

---
 include/mk/env_post.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/mk/env_post.mk +1 -3
index 913bdf5d1..3ffdd0b7f 100644
@@ -41,11 +41,9 @@ ifeq ($(UCLINUX),1)
 CPPFLAGS			+= -D__UCLIBC__ -DUCLINUX
 endif
 
-ifeq ($(ANDROID),1)
-# There are many undeclared functions, it's best not to accidentally overlook
-# them.
 CFLAGS				+= -Werror-implicit-function-declaration
 
+ifeq ($(ANDROID),1)
 LDFLAGS				+= -L$(top_builddir)/lib/android_libpthread
 LDFLAGS				+= -L$(top_builddir)/lib/android_librt
 endif
Signature · 1 line
2.20.1
author
#13 lore raw

RFC PATCH 3/3 make: Add -Werror-implicit-function-declaration for all targets

Hi,

Quoted 18 lines

Previously it was passed only to Android build, but it's good to check it for all.

---
Tested in travis:
https://travis-ci.org/pevik/ltp/builds/518886113

---
 include/mk/env_post.mk | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
include/mk/env_post.mk +0 -0
index 913bdf5d1..3ffdd0b7f 100644
@@ -41,11 +41,9 @@ ifeq ($(UCLINUX),1)
 CPPFLAGS			+= -D__UCLIBC__ -DUCLINUX
 endif

include/mk/env_post.mk ifeq ($(UCLINUX),1) · line 49

Quoted 10 lines
include/mk/env_post.mk +1 -3
 
-ifeq ($(ANDROID),1)
-# There are many undeclared functions, it's best not to accidentally overlook
-# them.
 CFLAGS				+= -Werror-implicit-function-declaration
 
+ifeq ($(ANDROID),1)
 LDFLAGS				+= -L$(top_builddir)/lib/android_libpthread
 LDFLAGS				+= -L$(top_builddir)/lib/android_librt
 endif

Ping, please. Drop it or merge?

Kind regards,
Petr

#14 lore raw

RFC PATCH 3/3 make: Add -Werror-implicit-function-declaration for all targets

Hi!

Quoted 13 lines
Quoted 12 lines
include/mk/env_post.mk +0 -3
index 913bdf5d1..3ffdd0b7f 100644
@@ -41,11 +41,9 @@ ifeq ($(UCLINUX),1)
 CPPFLAGS			+= -D__UCLIBC__ -DUCLINUX
 endif
 
-ifeq ($(ANDROID),1)
-# There are many undeclared functions, it's best not to accidentally overlook
-# them.
 CFLAGS				+= -Werror-implicit-function-declaration
Quoted 6 lines

include/mk/env_post.mk ifeq ($(UCLINUX),1) · line 49

Quoted 4 lines
include/mk/env_post.mk +1 -0
+ifeq ($(ANDROID),1)
 LDFLAGS				+= -L$(top_builddir)/lib/android_libpthread
 LDFLAGS				+= -L$(top_builddir)/lib/android_librt
 endif

Ping, please. Drop it or merge?

My opinion on Werror flags is that they should be on for development but disabled for releases and production. The question is how to implement something like this.

On the other hand we do have a CI so most problems would be caught there...

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#15 lore raw

RFC PATCH 3/3 make: Add -Werror-implicit-function-declaration for all targets

Hi Cyril,

Quoted 19 lines

Hi!

Quoted 17 lines
Quoted 17 lines
include/mk/env_post.mk +1 -3
index 913bdf5d1..3ffdd0b7f 100644
@@ -41,11 +41,9 @@ ifeq ($(UCLINUX),1)
 CPPFLAGS			+= -D__UCLIBC__ -DUCLINUX
 endif
 
-ifeq ($(ANDROID),1)
-# There are many undeclared functions, it's best not to accidentally overlook
-# them.
 CFLAGS				+= -Werror-implicit-function-declaration
 
+ifeq ($(ANDROID),1)
 LDFLAGS				+= -L$(top_builddir)/lib/android_libpthread
 LDFLAGS				+= -L$(top_builddir)/lib/android_librt
 endif
Quoted 8 lines
Quoted 1 line

Ping, please. Drop it or merge?

My opinion on Werror flags is that they should be on for development but disabled for releases and production. The question is how to implement something like this.

On the other hand we do have a CI so most problems would be caught there...

Good point. I'll post a new patch remove it here and add it for travis. It will be therefore disabled for Android, hope it's ok.

Kind regards,
Petr