From 7584a3f96de88d5eefe5d6c634515278cbfbf052 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 20 Feb 2016 12:56:55 +0100 Subject: Deprecate readdir_r, readdir64_r [BZ #19056] --- posix/tst-dir.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'posix') diff --git a/posix/tst-dir.c b/posix/tst-dir.c index 8897f8e..d0e4878 100644 --- a/posix/tst-dir.c +++ b/posix/tst-dir.c @@ -319,6 +319,10 @@ main (int argc, char *argv[]) exit (1); } + /* The test below covers the deprecated readdir64_r function. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations"); + /* Try to find the new directory. */ rewinddir (dir1); while (readdir64_r (dir1, &direntbuf.d, &d) == 0 && d != NULL) @@ -351,6 +355,8 @@ main (int argc, char *argv[]) } } + DIAG_POP_NEEDS_COMMENT; + if (d == NULL) { printf ("haven't found new directory \"%s\"\n", buf); @@ -439,6 +445,10 @@ main (int argc, char *argv[]) result = 1; } + /* The test below covers the deprecated readdir64_r function. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations"); + /* We now should have a directory and a file in the new directory. */ rewinddir (dir2); while (readdir64_r (dir2, &direntbuf.d, &d) == 0 && d != NULL) @@ -492,6 +502,8 @@ main (int argc, char *argv[]) } } + DIAG_POP_NEEDS_COMMENT; + if (stat64 ("does-not-exist", &st1) >= 0) { puts ("stat for unexisting file did not fail"); -- cgit v1.1