Use G_GNUC_UNUSED to suppress warning

On gcc-4.4 (void)<expr> doesn't suppress warnings from
__attribute__((warn_unused_result)), so use
G_GNUC_UNUSED (which expands to __attribute__((unused))) instead
of removing a dummy variable.

https://bugzilla.gnome.org/show_bug.cgi?id=640508
This commit is contained in:
Owen W. Taylor 2011-01-24 22:56:09 -05:00
parent 4f079affea
commit 19d1f97600

View File

@ -442,7 +442,9 @@ sigterm_handler (int signum)
{ {
if (sigterm_pipe_fds[1] >= 0) if (sigterm_pipe_fds[1] >= 0)
{ {
(void) write (sigterm_pipe_fds[1], "", 1); int G_GNUC_UNUSED dummy;
dummy = write (sigterm_pipe_fds[1], "", 1);
close (sigterm_pipe_fds[1]); close (sigterm_pipe_fds[1]);
sigterm_pipe_fds[1] = -1; sigterm_pipe_fds[1] = -1;
} }