[RFC PATCH 6/9] cli: fix another warning about variadic macros

Jani Nikula jani at nikula.org
Sat Jan 7 15:26:20 PST 2012


notmuch-setup.c: In function ‘notmuch_setup_command’:
notmuch-setup.c:144:62: warning: ISO C99 requires rest arguments to be used [enabled by default]
notmuch-setup.c:174:18: warning: ISO C99 requires rest arguments to be used [enabled by default]

Signed-off-by: Jani Nikula <jani at nikula.org>
---
 notmuch-setup.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/notmuch-setup.c b/notmuch-setup.c
index c3ea937..7b25680 100644
--- a/notmuch-setup.c
+++ b/notmuch-setup.c
@@ -102,9 +102,9 @@ notmuch_setup_command (unused (void *ctx),
     const char **new_tags;
     size_t new_tags_len;
 
-#define prompt(format, ...)					\
+#define __prompt(format, ...)					\
     do {							\
-	printf (format, ##__VA_ARGS__);				\
+	printf (format, __VA_ARGS__);				\
 	fflush (stdout);					\
 	if (getline (&response, &response_size, stdin) < 0) {	\
 	    printf ("Exiting.\n");				\
@@ -113,6 +113,9 @@ notmuch_setup_command (unused (void *ctx),
 	chomp_newline (response);				\
     } while (0)
 
+#define _prompt(format, ...) __prompt(format "%s", __VA_ARGS__)
+#define prompt(...) _prompt(__VA_ARGS__, "")
+
     config = notmuch_config_open (ctx, NULL, &is_new);
 
     if (is_new)
-- 
1.7.5.4



More information about the notmuch mailing list