[PATCH] chg: silence warning of unused parameter 'sig'

Yuya Nishihara yuya at tcha.org
Tue Jun 28 14:30:13 UTC 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1467121146 -32400
#      Tue Jun 28 22:39:06 2016 +0900
# Node ID 6092992b98fa30d9ea30e0a05f4a7682b99862c6
# Parent  7dce56174916e09be39c690278942b4f7567b3f6
chg: silence warning of unused parameter 'sig'

diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c
--- a/contrib/chg/chg.c
+++ b/contrib/chg/chg.c
@@ -381,7 +381,7 @@ error:
 	abortmsgerrno("failed to handle stop signal");
 }
 
-static void handlechildsignal(int sig)
+static void handlechildsignal(int sig UNUSED_)
 {
 	if (peerpid == 0 || pagerpid == 0)
 		return;
diff --git a/contrib/chg/util.h b/contrib/chg/util.h
--- a/contrib/chg/util.h
+++ b/contrib/chg/util.h
@@ -12,8 +12,10 @@
 
 #ifdef __GNUC__
 #define PRINTF_FORMAT_ __attribute__((format(printf, 1, 2)))
+#define UNUSED_ __attribute__((unused))
 #else
 #define PRINTF_FORMAT_
+#define UNUSED_
 #endif
 
 void abortmsg(const char *fmt, ...) PRINTF_FORMAT_;


More information about the Mercurial-devel mailing list