Mercurial > hg > octave-kai > gnulib-hg
changeset 16075:e3c3fdcd0910
ptsname_r test: Avoid gcc warning on glibc systems.
* tests/test-ptsname_r.c (null_ptr): New function.
(test_errors): Use it.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 10 Nov 2011 13:56:40 +0100 |
parents | cd0ee16f47e9 |
children | 34f07bcc4983 |
files | ChangeLog tests/test-ptsname_r.c |
diffstat | 2 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-11-10 Bruno Haible <bruno@clisp.org> + + 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 <bruno@clisp.org> ptsname_r: Avoid compilation error on OSF/1 5.1.
--- 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);