From: Martin Pool Date: Sat, 23 Feb 2002 00:17:50 +0000 (+0000) Subject: Add UNUSED macro that expands to a parameter attribute annotation on X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/0f0ea7f779623fc4cad2bbf8c955b32d37588127 Add UNUSED macro that expands to a parameter attribute annotation on gcc, to quieten its worries about parameters that must always be unused. --- diff --git a/main.c b/main.c index be8d0c2a..74d205f0 100644 --- a/main.c +++ b/main.c @@ -786,17 +786,17 @@ static int start_client(int argc, char *argv[]) } -static RETSIGTYPE sigusr1_handler(int val) { +static RETSIGTYPE sigusr1_handler(int UNUSED(val)) { exit_cleanup(RERR_SIGNAL); } -static RETSIGTYPE sigusr2_handler(int val) { +static RETSIGTYPE sigusr2_handler(int UNUSED(val)) { extern int log_got_error; if (log_got_error) _exit(RERR_PARTIAL); _exit(0); } -static RETSIGTYPE sigchld_handler(int val) { +static RETSIGTYPE sigchld_handler(int UNUSED(val)) { #ifdef WNOHANG while (waitpid(-1, NULL, WNOHANG) > 0) ; #endif diff --git a/rsync.h b/rsync.h index 2bfe2506..449ce094 100644 --- a/rsync.h +++ b/rsync.h @@ -609,3 +609,9 @@ inet_ntop(int af, const void *src, char *dst, size_t size); #ifndef HAVE_INET_PTON int isc_net_pton(int af, const char *src, void *dst); #endif + +#ifdef __GNUC__ +# define UNUSED(x) x __attribute__((__unused__)) +#else +# define UNUSED(x) x +#endif /* ndef __GNUC__ */