]> git.notmuchmail.org Git - notmuch/commitdiff
Re-enable the warning for unused parameters.
authorCarl Worth <cworth@cworth.org>
Sun, 25 Oct 2009 22:53:27 +0000 (15:53 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 25 Oct 2009 22:53:27 +0000 (15:53 -0700)
It's easy enough to squelch the warning with an __attribute__ ((unused))
and it might just catch something for us in the future.

Makefile
notmuch-private.h
notmuch.c

index 3a8cda90fb09751d013c58f8feca8c8952f7478f..6e3ab26d3b8bc069c41ea85341d448be89d4b4fc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 PROGS=notmuch
 
-CXXWARNINGS_FLAGS=-Wall -Wextra -Wno-unused-parameter
+CXXWARNINGS_FLAGS=-Wall -Wextra
 CWARNINGS_FLAGS=$(CXXWARNINGS_FLAGS)
 
 CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc`
index be1fb63fe9a1227130501ffc62276b7c8ff3018a..aac67b2e4bcf51737bb9b5be6452380f3b5fc33f 100644 (file)
@@ -72,6 +72,8 @@ _internal_error (const char *format, ...) PRINTF_ATTRIBUTE (1, 2);
     _internal_error (format " (%s).\n",                        \
                     ##__VA_ARGS__, __location__)
 
+#define unused(x) x __attribute__ ((unused))
+
 /* Thanks to Andrew Tridgell's (SAMBA's) talloc for this definition of
  * unlikely. The talloc source code comes to us via the GNU LGPL v. 3.
  */
index 10782d4deadf9c2979a44c02541fdd351b298ca0..d98935bd4f73d2045f28466a9ac5156f40c21ac4 100644 (file)
--- a/notmuch.c
+++ b/notmuch.c
@@ -43,6 +43,8 @@
 
 #include <glib.h> /* g_strdup_printf */
 
+#define unused(x) x __attribute__ ((unused))
+
 /* There's no point in continuing when we've detected that we've done
  * something wrong internally (as opposed to the user passing in a
  * bogus value).
@@ -399,7 +401,7 @@ count_files (const char *path, int *count)
 }
 
 int
-setup_command (int argc, char *argv[])
+setup_command (unused (int argc), unused (char *argv[]))
 {
     notmuch_database_t *notmuch = NULL;
     char *default_path, *mail_directory = NULL;
@@ -525,7 +527,7 @@ setup_command (int argc, char *argv[])
 }
 
 int
-new_command (int argc, char *argv[])
+new_command (unused (int argc), unused (char *argv[]))
 {
     notmuch_database_t *notmuch;
     const char *mail_directory;
@@ -667,7 +669,7 @@ search_command (int argc, char *argv[])
 }
 
 int
-show_command (int argc, char *argv[])
+show_command (unused (int argc), unused (char *argv[]))
 {
     fprintf (stderr, "Error: show is not implemented yet.\n");
     return 1;