glibc/dlfcn/bug-atexit3-lib.cc
Gabriel F T Gomes 1b16ff0b1e 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.
2016-10-28 19:26:14 -02:00

32 lines
425 B
C++

#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_message ("statclass\n");
}
~statclass()
{
write_message ("~statclass\n");
}
};
struct extclass
{
~extclass()
{
static statclass var;
}
};
extclass globvar;