From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 2FE216DE0F0D for ; Thu, 30 May 2019 12:56:24 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.224 X-Spam-Level: X-Spam-Status: No, score=0.224 tagged_above=-999 required=5 tests=[AWL=-0.025, HEADER_FROM_DIFFERENT_DOMAINS=0.249] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7buBA_z7hek3 for ; Thu, 30 May 2019 12:56:21 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id E65396DE0EF9 for ; Thu, 30 May 2019 12:56:19 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 2399B1000B0; Thu, 30 May 2019 22:56:16 +0300 (EEST) From: Tomi Ollila To: notmuch@notmuchmail.org Cc: tomi.ollila@iki.fi Subject: [PATCH] append _unused to the expression defined using unused() macro Date: Thu, 30 May 2019 22:56:14 +0300 Message-Id: <20190530195614.7745-1-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.13.3 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 19:56:24 -0000 This way if variables defined using unused() macro are actually used then code will not compile... - removed unused usage around one argc and one argv since those were used - changed one unused (char *argv[]) to unused (char **argv) to work with modified unused() macro definition --- Noticed this when looking some dkg's changes (not in his code, but in diff context). I cannot think of a case where this would not work. (and note to self: fix similar unused() definition on some of my own projects, forgot '##' there (a_unused does not expand macro variable a ;)) notmuch-client.h | 2 +- notmuch-setup.c | 2 +- notmuch.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/notmuch-client.h b/notmuch-client.h index 39e26f2e..b3a501a9 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -53,7 +53,7 @@ #include "talloc-extra.h" #include "crypto.h" -#define unused(x) x __attribute__ ((unused)) +#define unused(x) x ## _unused __attribute__ ((unused)) #define STRINGIFY(s) STRINGIFY_(s) #define STRINGIFY_(s) #s diff --git a/notmuch-setup.c b/notmuch-setup.c index 53048005..81419ccf 100644 --- a/notmuch-setup.c +++ b/notmuch-setup.c @@ -121,7 +121,7 @@ parse_tag_list (void *ctx, char *response) int notmuch_setup_command (notmuch_config_t *config, - unused (int argc), unused (char *argv[])) + int argc, char *argv[]) { char *response = NULL; size_t response_size = 0; diff --git a/notmuch.c b/notmuch.c index eeb794e8..2ddc8fbc 100644 --- a/notmuch.c +++ b/notmuch.c @@ -358,7 +358,7 @@ notmuch_help_command (unused (notmuch_config_t * config), int argc, char *argv[] */ static int notmuch_command (notmuch_config_t *config, - unused(int argc), unused(char *argv[])) + unused(int argc), unused(char **argv)) { char *db_path; struct stat st; -- 2.21.0