From 8f0a947cf55f3b0c4ebdf06953c57eff67a22fa9 Mon Sep 17 00:00:00 2001 From: Arjun Shankar Date: Mon, 29 May 2017 16:12:31 +0200 Subject: Remove check for NULL buffer passed to `ptsname_r' `ptsname_r' is declared in stdlib.h to only accept a `nonnull' second argument and therefore GCC may choose to make optimizations based on the assumption that this argument is NULL. This means that potentially, GCC can optimize away the NULL check at some point in the future. Since this is a programming interface, we might as well remove the NULL check ourselves. This also warrants a change to the `ptsname_r' manual page that must be submitted to the corresponding mailing list. In addition, remove the NULL buffer test in login/tst-ptsname.c. --- login/tst-ptsname.c | 1 - 1 file changed, 1 deletion(-) (limited to 'login') diff --git a/login/tst-ptsname.c b/login/tst-ptsname.c index be8744dfd0..96f0449788 100644 --- a/login/tst-ptsname.c +++ b/login/tst-ptsname.c @@ -70,7 +70,6 @@ do_test (void) if (fd != -1) { result |= do_single_test (fd, buf, sizeof (buf), 0); - result |= do_single_test (fd, NULL, sizeof (buf), EINVAL); result |= do_single_test (fd, buf, 1, ERANGE); close (fd); } -- cgit v1.2.3