From 5e0ed4fa0a68fde14782f68c7461b8b95176515b Mon Sep 17 00:00:00 2001 From: ngie Date: Sat, 5 Dec 2015 21:49:35 +0000 Subject: MFC r283801,r290846,r290851,r290856,r290860: r283801 (by araujo): Fix warning of implicit declaration of function 'mkdir'. Differential Revision: D2662 Reviewed by: rodrigc, ngie r290846: Bump WARNS to 2 Sponsored by: EMC / Isilon Storage Division r290851: Change WARNS to 2 across the board with all the libc testcases This effectively "reverts" r290846 Sponsored by: EMC / Isilon Storage Division r290856 (by bapt): also skip the definition of ':fopen_regular' to avoid the build to fail due to unused variables defined by ATF macros r290860 (by bapt): Remove unused variables to fix building world --- contrib/netbsd-tests/lib/libc/c063/t_faccessat.c | 3 +++ contrib/netbsd-tests/lib/libc/c063/t_openat.c | 3 +++ contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c | 3 +++ contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c | 3 +++ lib/libc/tests/Makefile.netbsd-tests | 2 ++ lib/libc/tests/stdio/fmemopen2_test.c | 3 +-- lib/libc/tests/stdio/getdelim_test.c | 1 - lib/libc/tests/stdio/perror_test.c | 2 +- lib/libc/tests/stdio/scanfloat_test.c | 9 --------- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c index 5afdee9..99235ea 100644 --- a/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c +++ b/contrib/netbsd-tests/lib/libc/c063/t_faccessat.c @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_faccessat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); #include #include #include +#ifdef __FreeBSD__ +#include +#endif #define DIR "dir" #define FILE "dir/faccessat" diff --git a/contrib/netbsd-tests/lib/libc/c063/t_openat.c b/contrib/netbsd-tests/lib/libc/c063/t_openat.c index 79b5f38..5112efc 100644 --- a/contrib/netbsd-tests/lib/libc/c063/t_openat.c +++ b/contrib/netbsd-tests/lib/libc/c063/t_openat.c @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_openat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); #include #include #include +#ifdef __FreeBSD__ +#include +#endif #define DIR "dir" #define FILE "dir/openat" diff --git a/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c b/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c index d354ff5..c9bc267 100644 --- a/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c +++ b/contrib/netbsd-tests/lib/libc/c063/t_readlinkat.c @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_readlinkat.c,v 1.3 2013/03/17 04:46:06 jmmv Exp $"); #include #include #include +#ifdef __FreeBSD__ +#include +#endif #define DIR "dir" #define FILE "dir/readlinkat" diff --git a/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c b/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c index 79aa7aa..220c4b2 100644 --- a/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c +++ b/contrib/netbsd-tests/lib/libc/c063/t_unlinkat.c @@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_unlinkat.c,v 1.2 2013/03/17 04:46:06 jmmv Exp $"); #include #include #include +#ifdef __FreeBSD__ +#include +#endif #define DIR "dir" #define FILE "dir/unlinkat" diff --git a/lib/libc/tests/Makefile.netbsd-tests b/lib/libc/tests/Makefile.netbsd-tests index f364b1c..56472fb 100644 --- a/lib/libc/tests/Makefile.netbsd-tests +++ b/lib/libc/tests/Makefile.netbsd-tests @@ -4,4 +4,6 @@ OBJTOP?= ${.OBJDIR:H:H:H:H} SRCTOP?= ${.CURDIR:H:H:H:H} TESTSRC?= ${SRCTOP}/contrib/netbsd-tests/lib/libc/${.CURDIR:T} +WARNS?= 2 + .include diff --git a/lib/libc/tests/stdio/fmemopen2_test.c b/lib/libc/tests/stdio/fmemopen2_test.c index d4a14a8..62831fb 100644 --- a/lib/libc/tests/stdio/fmemopen2_test.c +++ b/lib/libc/tests/stdio/fmemopen2_test.c @@ -104,10 +104,9 @@ ATF_TC_WITHOUT_HEAD(test_autoalloc); ATF_TC_BODY(test_autoalloc, tc) { /* Let fmemopen allocate the buffer. */ - char str[] = "A quick test"; FILE *fp; long pos; - size_t nofw, nofr, i; + size_t nofw, i; int rc; /* Open a FILE * using fmemopen. */ diff --git a/lib/libc/tests/stdio/getdelim_test.c b/lib/libc/tests/stdio/getdelim_test.c index 890c74a..5ef589a 100644 --- a/lib/libc/tests/stdio/getdelim_test.c +++ b/lib/libc/tests/stdio/getdelim_test.c @@ -113,7 +113,6 @@ ATF_TC_BODY(getline_basic, tc) ATF_TC_WITHOUT_HEAD(stream_error); ATF_TC_BODY(stream_error, tc) { - FILE *fp; char *line; size_t linecap; diff --git a/lib/libc/tests/stdio/perror_test.c b/lib/libc/tests/stdio/perror_test.c index a58121c..989f1ff 100644 --- a/lib/libc/tests/stdio/perror_test.c +++ b/lib/libc/tests/stdio/perror_test.c @@ -48,7 +48,7 @@ static char tmpfil[PATH_MAX]; ATF_TC_WITHOUT_HEAD(perror_test); ATF_TC_BODY(perror_test, tc) { - char buf[512], lbuf[512]; + char lbuf[512]; int i; char *s; diff --git a/lib/libc/tests/stdio/scanfloat_test.c b/lib/libc/tests/stdio/scanfloat_test.c index 60c1b61..7e27e69 100644 --- a/lib/libc/tests/stdio/scanfloat_test.c +++ b/lib/libc/tests/stdio/scanfloat_test.c @@ -58,7 +58,6 @@ ATF_TC_BODY(normalized_numbers, tc) long double ld = 0.0; double d = 0.0; float f = 0.0; - char *endp; buf[0] = '\0'; ATF_REQUIRE(setlocale(LC_NUMERIC, "")); @@ -157,7 +156,6 @@ ATF_TC_BODY(infinities_and_nans, tc) long double ld = 0.0; double d = 0.0; float f = 0.0; - char *endp; ATF_REQUIRE(setlocale(LC_NUMERIC, "C")); @@ -205,11 +203,8 @@ ATF_TC_BODY(infinities_and_nans, tc) ATF_TC_WITHOUT_HEAD(rounding_tests); ATF_TC_BODY(rounding_tests, tc) { - char buf[128]; long double ld = 0.0; double d = 0.0; - float f = 0.0; - char *endp; ATF_REQUIRE(setlocale(LC_NUMERIC, "C")); @@ -287,10 +282,6 @@ ATF_TC_BODY(rounding_tests, tc) ATF_TC_WITHOUT_HEAD(strtod); ATF_TC_BODY(strtod, tc) { - char buf[128]; - long double ld = 0.0; - double d = 0.0; - float f = 0.0; char *endp; ATF_REQUIRE(setlocale(LC_NUMERIC, "C")); -- cgit v1.1