[mutter] Use G_GNUC_UNUSED to suppress warning



commit 19d1f97600dc105cdb7bfaa1c075e06b611ea5ef
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Jan 24 22:56:09 2011 -0500

    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

 src/core/main.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/core/main.c b/src/core/main.c
index 1ea6f5d..c517b5c 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -442,7 +442,9 @@ sigterm_handler (int signum)
 {
   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]);
       sigterm_pipe_fds[1] = -1;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]