]> sourceware.org Git - glibc.git/commitdiff
Fix warning caused by unused-result in bug-atexit3-lib.cc
authorGabriel F T Gomes <gftg@linux.vnet.ibm.com>
Fri, 28 Oct 2016 17:57:15 +0000 (15:57 -0200)
committerGabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Fri, 28 Oct 2016 21:26:14 +0000 (19:26 -0200)
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.

ChangeLog
dlfcn/bug-atexit3-lib.cc

index eed5cc5f370ae8991b04dcab04d26522ff2e95ed..d49f22153a0f03111d27726f59cc4a28003c08ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-28  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+       * dlfcn/bug-atexit3-lib.cc (write_message): New function, copied
+       from test-skeleton.c.
+       (statclass): Replace calls to write with calls to write_message.
+
 2016-10-28  Joseph Myers  <joseph@codesourcery.com>
 
        * math/math.h
index 3d01ea81d2d750cb4f7209d139b849e86f9edb99..aba772004d50bd2c167dcbad8ff984d3c106828f 100644 (file)
@@ -1,14 +1,22 @@
 #include <unistd.h>
+#include <string.h>
+
+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");
   }
 };
 
This page took 0.157958 seconds and 5 git commands to generate.