Silence GCC warn_unused_result warnings in tests

warn_unused_result is the persistent one that won't go away with a
simple `(void)write(...)` and needs to be assigned to a variable (that
must then also be declared unused or else you'll get a warning about
_that_).
This commit is contained in:
Mahmoud Al-Qudsi 2020-11-29 18:12:09 -06:00
parent 74b298a6f9
commit 8aac537191

View File

@ -115,11 +115,11 @@ static void print_ignored_signals() {
static void print_stop_cont() { static void print_stop_cont() {
signal(SIGTSTP, [](int) { signal(SIGTSTP, [](int) {
write(STDOUT_FILENO, "SIGTSTP\n", strlen("SIGTSTP\n")); auto __attribute__((unused)) _ = write(STDOUT_FILENO, "SIGTSTP\n", strlen("SIGTSTP\n"));
kill(getpid(), SIGSTOP); kill(getpid(), SIGSTOP);
}); });
signal(SIGCONT, [](int) { signal(SIGCONT, [](int) {
write(STDOUT_FILENO, "SIGCONT\n", strlen("SIGCONT\n")); auto __attribute__((unused)) _ = write(STDOUT_FILENO, "SIGCONT\n", strlen("SIGCONT\n"));
}); });
char buff[1]; char buff[1];
for (;;) { for (;;) {