From 1b16ff0b1e6906d4f5a4380c4ca5750e87c5e52d Mon Sep 17 00:00:00 2001 From: Gabriel F T Gomes Date: Fri, 28 Oct 2016 15:57:15 -0200 Subject: Fix warning caused by unused-result in bug-atexit3-lib.cc The test case dlfcn/bug-atexit3-lib.cc calls write and doesn't check the result. When building with GCC 6.2, this generates a warning in 'make check', which is treated as an error. This patch replaces the call to write with a call to write_message. Tested for powerpc64le. --- dlfcn/bug-atexit3-lib.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'dlfcn') diff --git a/dlfcn/bug-atexit3-lib.cc b/dlfcn/bug-atexit3-lib.cc index 3d01ea81d2..aba772004d 100644 --- a/dlfcn/bug-atexit3-lib.cc +++ b/dlfcn/bug-atexit3-lib.cc @@ -1,14 +1,22 @@ #include +#include + +static void +write_message (const char *message) +{ + ssize_t unused __attribute__ ((unused)); + unused = write (STDOUT_FILENO, message, strlen (message)); +} struct statclass { statclass() { - write (1, "statclass\n", 10); + write_message ("statclass\n"); } ~statclass() { - write (1, "~statclass\n", 11); + write_message ("~statclass\n"); } }; -- cgit v1.2.3