From 5be861ac45514c2a0bc4c328de34af48fdad4283 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 10 Nov 2011 13:56:40 +0100 Subject: [PATCH] ptsname_r test: Avoid gcc warning on glibc systems. * tests/test-ptsname_r.c (null_ptr): New function. (test_errors): Use it. --- ChangeLog | 6 ++++++ tests/test-ptsname_r.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5ac22c28f4..0c4eff930d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-11-10 Bruno Haible + + ptsname_r test: Avoid gcc warning on glibc systems. + * tests/test-ptsname_r.c (null_ptr): New function. + (test_errors): Use it. + 2011-11-10 Bruno Haible ptsname_r: Avoid compilation error on OSF/1 5.1. diff --git a/tests/test-ptsname_r.c b/tests/test-ptsname_r.c index 5906e2e2a5..76521fe7fd 100644 --- a/tests/test-ptsname_r.c +++ b/tests/test-ptsname_r.c @@ -53,6 +53,12 @@ same_slave (const char *slave_name1, const char *slave_name2) && SAME_INODE (statbuf1, statbuf2))); } +static char * +null_ptr (void) +{ + return NULL; +} + static void test_errors (int fd, const char *slave) { @@ -86,7 +92,7 @@ test_errors (int fd, const char *slave) } errno = 0; - result = ptsname_r (fd, NULL, 0); + result = ptsname_r (fd, null_ptr (), 0); ASSERT (result != 0); ASSERT (result == errno); ASSERT (errno == EINVAL); -- 2.39.5