[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/4] ptsname_r-tests: new test module
From: |
Bruno Haible |
Subject: |
Re: [PATCH 2/4] ptsname_r-tests: new test module |
Date: |
Thu, 10 Nov 2011 13:57:01 +0100 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Eric Blake wrote:
> + result = ptsname_r (fd, NULL, 0);
On glibc 2.11, with CPPFLAGS=-Wall, this code gives a warning:
test-ptsname_r.c: In function 'test_errors':
test-ptsname_r.c:88:3: warning: null argument where non-null required (argument
2)
I'm copying the trick from test-memmem.c:
2011-11-10 Bruno Haible <address@hidden>
ptsname_r test: Avoid gcc warning on glibc systems.
* tests/test-ptsname_r.c (null_ptr): New function.
(test_errors): Use it.
--- tests/test-ptsname_r.c.orig Thu Nov 10 13:55:45 2011
+++ tests/test-ptsname_r.c Thu Nov 10 13:54:31 2011
@@ -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);
--
In memoriam Cornstalk <http://en.wikipedia.org/wiki/Cornstalk>
- [PATCH 0/4] add ptsname_r, Eric Blake, 2011/11/07
- [PATCH 2/4] ptsname_r-tests: new test module, Eric Blake, 2011/11/07
- Re: [PATCH 2/4] ptsname_r-tests: new test module, Bruno Haible, 2011/11/08
- Re: [PATCH 2/4] ptsname_r-tests: new test module, Eric Blake, 2011/11/09
- Re: [PATCH 2/4] ptsname_r-tests: new test module, Bruno Haible, 2011/11/09
- Re: [PATCH 2/4] ptsname_r-tests: new test module, Bruno Haible, 2011/11/09
- ptsname_r testing, Bruno Haible, 2011/11/10
- Re: ptsname_r on OSF/1, Bruno Haible, 2011/11/10
- Re: [PATCH 2/4] ptsname_r-tests: new test module,
Bruno Haible <=
- Re: [PATCH 2/4] ptsname_r-tests: new test module, Bruno Haible, 2011/11/10
- Re: [PATCH 2/4] ptsname_r-tests: new test module, Eric Blake, 2011/11/10
- Re: [PATCH 2/4] ptsname_r-tests: new test module, Bruno Haible, 2011/11/10
- Re: [PATCH 2/4] ptsname_r-tests: new test module, Eric Blake, 2011/11/10
[PATCH 4/4] ptsname_r: work around FreeBSD issue, Eric Blake, 2011/11/07
[PATCH 3/4] ptsname_r: port to Solaris, Eric Blake, 2011/11/07
[PATCH 1/4] ptsname_r: new module, Eric Blake, 2011/11/07