I'm building GnuPG and components from Master using GCC 7.5 on Ubuntu Bionic with the standard project settings. There's some noise from GCC about ignoring return values from write.
Since the void cast is no longer working as expected.... I believe the way to clear the noise in a portable way is:
#ifndef UNUSED # define UNUSED(x) ((void)(x)) #endif ssize_t res = write (2, "\n", 1 ); UNUSED(res);
signal.c: In function ‘got_fatal_signal’: signal.c:111:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] (void)write (2, "\n", 1 ); ^~~~~~~~~~~~~~~~~~~~~~~~~ signal.c:114:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] (void)write(2, s, strlen (s)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ signal.c:115:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] (void)write (2, ": signal ", 9 ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ signal.c:118:5: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] (void) write (2, s, strlen(s) ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ signal.c:128:9: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] (void)write (2, "?", 1); ^~~~~~~~~~~~~~~~~~~~~~~ signal.c:137:19: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] (void)write (2, &"0123456789"[value/i], 1); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ signal.c:145:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] (void)write (2, " caught ... exiting\n", 20); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~