Android fixes and -Werror-implicit-function-declaration as default
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
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
@@ -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
RFC PATCH 1/3 cve/cve-2014-0196: Don't use libutil for Android
Quoted 6 lines · Petr Vorel
From: Petr Vorel <[email protected]>
as it's not available for it.
Signed-off-by Petr Vorel <[email protected]>Signed-off-by Petr Vorel <[email protected]>
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.
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
Signed-off-by Petr Vorel <[email protected]>Signed-off-by Petr Vorel <[email protected]>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.
Acked-by Sandeep Patil <[email protected]>
Thanks for your review, pushed this one.
Kind regards,
Petr
RFC PATCH 2/3 Add more missing <string.h> and <strings.h> includes
In reply to Petr VorelFrom: 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
@@ -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
@@ -7,6 +7,8 @@#ifndef TST_NUMA_H__ #define TST_NUMA_H__ +#include <string.h> +/** * Numa nodemap. */
lib/tst_af_alg.c +1 -0
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -28,6 +28,7 @@*/ #include <errno.h> +#include <string.h> #include "tst_test.h"
testcases/kernel/syscalls/setsockopt/setsockopt03.c +1 -0
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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]>
Signed-off-by Petr Vorel <[email protected]>Signed-off-by 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@@ -17,6 +17,7 @@#include <arpa/inet.h> #include <errno.h> +#include <string.h> #define MAX_IPV4_PREFIX 32#define MAX_IPV6_PREFIX 128include/tst_numa.h +2
-0@@ -7,6 +7,8 @@#ifndef TST_NUMA_H__ #define TST_NUMA_H__ +#include <string.h> +/** * Numa nodemap. */ lib/tst_af_alg.c +0
-0
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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -37,6 +37,7 @@#include <fcntl.h> #include <sys/types.h> #include <unistd.h> +#include <string.h> #include "tst_test.h" #define TIMEOUT 5testcases/kernel/syscalls/getrandom/getrandom02.c +2
-0@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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@@ -32,6 +32,7 @@*/ #include <errno.h> +#include <string.h> #include "tst_test.h" #define SIZE 512testcases/kernel/syscalls/request_key/request_key03.c +1
-0@@ -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@@ -28,6 +28,7 @@*/ #include <errno.h> +#include <string.h> #include "tst_test.h" testcases/kernel/syscalls/setsockopt/setsockopt03.c +1
-0@@ -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@@ -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@@ -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@@ -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@@ -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@@ -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
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>
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@@ -7,6 +7,8 @@#ifndef TST_NUMA_H__ #define TST_NUMA_H__ +#include <string.h> +/** * Numa nodemap. */ lib/tst_af_alg.c +0
-0@@ -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>?? intst_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]
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@@ -7,6 +7,8 @@#ifndef TST_NUMA_H__ #define TST_NUMA_H__ +#include <string.h> +/** * Numa nodemap. */ lib/tst_af_alg.c +0
-0@@ -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>?? intst_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
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@@ -7,6 +7,8 @@#ifndef TST_NUMA_H__ #define TST_NUMA_H__ +#include <string.h> +/** * Numa nodemap. */ lib/tst_af_alg.c +0
-0lib/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>?? intst_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>
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@@ -7,6 +7,8 @@#ifndef TST_NUMA_H__ #define TST_NUMA_H__ +#include <string.h> +/** * Numa nodemap. */ lib/tst_af_alg.c +0
-0lib/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>?? intst_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]
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 withmemset().
That explains, why <strings.h> is not much used nowadays.
Kind regards,
Petr
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> includesQuoted 24 lines
Hi,
Quoted 22 lines
Quoted 22 lines
Quoted 17 lines
include/tst_numa.h +2
-0@@ -7,6 +7,8 @@#ifndef TST_NUMA_H__ #define TST_NUMA_H__ +#include <string.h> +/** * Numa nodemap. */ lib/tst_af_alg.c +0
-0lib/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>?? intst_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>
RFC PATCH 3/3 make: Add -Werror-implicit-function-declaration for all targets
In reply to Petr VorelPreviously 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
@@ -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
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.
Signed-off-by Petr Vorel <[email protected]>---
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@@ -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
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@@ -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 endifPing, 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]
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@@ -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