# HG changeset patch # User Bruno Haible # Date 1320929800 -3600 # Node ID e3c3fdcd091010326e98e05f1612d2b5d190197b # Parent cd0ee16f47e95f1282e2c9d9a24b961c67dac622 ptsname_r test: Avoid gcc warning on glibc systems. * tests/test-ptsname_r.c (null_ptr): New function. (test_errors): Use it. diff --git a/ChangeLog b/ChangeLog --- 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 --- a/tests/test-ptsname_r.c +++ b/tests/test-ptsname_r.c @@ -53,6 +53,12 @@ && SAME_INODE (statbuf1, statbuf2))); } +static char * +null_ptr (void) +{ + return NULL; +} + static void test_errors (int fd, const char *slave) { @@ -86,7 +92,7 @@ } errno = 0; - result = ptsname_r (fd, NULL, 0); + result = ptsname_r (fd, null_ptr (), 0); ASSERT (result != 0); ASSERT (result == errno); ASSERT (errno == EINVAL);