Browse Source

Mark unused arguments in many modules.

Either with UNNEEDED (if the module already used ccan/compiler) or
with (void) casting.

The only other change is in ccan/list/test/run-CCAN_LIST_DEBUG.c, because
the linenumbers change and thus it needs updating.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 9 years ago
parent
commit
ad2ce76c10
73 changed files with 121 additions and 37 deletions
  1. 2 0
      ccan/array_size/test/compile_fail.c
  2. 1 1
      ccan/asort/test/compile_fail-context-type.c
  3. 1 1
      ccan/autodata/autodata.c
  4. 1 0
      ccan/cast/test/compile_ok-static.c
  5. 2 0
      ccan/check_type/test/compile_fail-check_type.c
  6. 2 0
      ccan/check_type/test/compile_fail-check_type_unsigned.c
  7. 1 0
      ccan/check_type/test/compile_fail-check_types_match.c
  8. 1 0
      ccan/check_type/test/run.c
  9. 1 1
      ccan/compiler/_info
  10. 3 1
      ccan/compiler/test/compile_fail-printf.c
  11. 2 0
      ccan/compiler/test/run-is_compile_constant.c
  12. 1 0
      ccan/crypto/siphash24/siphash24.c
  13. 1 0
      ccan/err/test/run.c
  14. 1 0
      ccan/htable/_info
  15. 1 0
      ccan/htable/htable.h
  16. 1 1
      ccan/htable/test/run-copy.c
  17. 1 1
      ccan/htable/test/run-size.c
  18. 1 1
      ccan/htable/test/run-type-int.c
  19. 1 1
      ccan/htable/test/run-zero-hash-first-entry.c
  20. 1 1
      ccan/htable/test/run.c
  21. 2 1
      ccan/list/test/run-CCAN_LIST_DEBUG.c
  22. 1 0
      ccan/list/test/run-check-corrupt.c
  23. 1 0
      ccan/mem/mem.h
  24. 1 1
      ccan/opt/opt.h
  25. 2 2
      ccan/opt/test/run-add_desc.c
  26. 1 1
      ccan/opt/test/run-helpers.c
  27. 3 3
      ccan/opt/test/run-set_alloc.c
  28. 3 3
      ccan/opt/test/run-usage.c
  29. 1 1
      ccan/opt/test/utils.c
  30. 2 1
      ccan/order/order.c
  31. 1 0
      ccan/read_write_all/test/run-read_all.c
  32. 3 0
      ccan/read_write_all/test/run-write_all.c
  33. 1 0
      ccan/str/test/compile_fail-isalnum.c
  34. 1 0
      ccan/str/test/compile_fail-isalpha.c
  35. 1 0
      ccan/str/test/compile_fail-isascii.c
  36. 1 0
      ccan/str/test/compile_fail-isblank.c
  37. 1 0
      ccan/str/test/compile_fail-iscntrl.c
  38. 1 0
      ccan/str/test/compile_fail-isdigit.c
  39. 1 0
      ccan/str/test/compile_fail-islower.c
  40. 1 0
      ccan/str/test/compile_fail-isprint.c
  41. 1 0
      ccan/str/test/compile_fail-ispunct.c
  42. 1 0
      ccan/str/test/compile_fail-isspace.c
  43. 1 0
      ccan/str/test/compile_fail-isupper.c
  44. 1 0
      ccan/str/test/compile_fail-isxdigit.c
  45. 2 1
      ccan/strmap/_info
  46. 1 1
      ccan/strmap/test/run-iterate-const.c
  47. 1 1
      ccan/strmap/test/run-prefix.c
  48. 1 1
      ccan/take/test/run.c
  49. 1 1
      ccan/tal/link/link.c
  50. 1 1
      ccan/tal/link/test/run.c
  51. 1 0
      ccan/tal/str/str.h
  52. 1 1
      ccan/tal/tal.c
  53. 1 1
      ccan/tal/test/run-allocfail.c
  54. 1 1
      ccan/tal/test/run-destructor.c
  55. 1 1
      ccan/tal/test/run-free.c
  56. 4 2
      ccan/tal/test/run-notifier.c
  57. 1 1
      ccan/tal/test/run-overflow.c
  58. 1 1
      ccan/tal/test/run-test-backend.c
  59. 1 0
      ccan/tcon/test/compile_ok-void.c
  60. 1 0
      ccan/tcon/test/compile_ok.c
  61. 1 0
      ccan/timer/_info
  62. 1 1
      ccan/timer/timer.c
  63. 1 0
      ccan/typesafe_cb/test/compile_fail-cast_if_type-promotable.c
  64. 1 0
      ccan/typesafe_cb/test/compile_fail-typesafe_cb-int.c
  65. 3 0
      ccan/typesafe_cb/test/compile_fail-typesafe_cb.c
  66. 1 0
      ccan/typesafe_cb/test/compile_fail-typesafe_cb_cast-multi.c
  67. 1 0
      ccan/typesafe_cb/test/compile_fail-typesafe_cb_cast.c
  68. 4 0
      ccan/typesafe_cb/test/compile_fail-typesafe_cb_postargs.c
  69. 4 0
      ccan/typesafe_cb/test/compile_fail-typesafe_cb_preargs.c
  70. 2 0
      ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c
  71. 11 0
      ccan/typesafe_cb/test/compile_ok-typesafe_cb-undefined.c
  72. 11 0
      ccan/typesafe_cb/test/compile_ok-typesafe_cb-vars.c
  73. 1 0
      ccan/typesafe_cb/test/compile_ok-typesafe_cb_cast.c

+ 2 - 0
ccan/array_size/test/compile_fail.c

@@ -2,6 +2,8 @@
 
 int main(int argc, char *argv[8])
 {
+	(void)argc;
+	(void)argv;
 	char array[100];
 #ifdef FAIL
 	return ARRAY_SIZE(argv) + ARRAY_SIZE(array);

+ 1 - 1
ccan/asort/test/compile_fail-context-type.c

@@ -1,7 +1,7 @@
 #include <ccan/asort/asort.h>
 #include <ccan/asort/asort.c>
 
-static int cmp(char *const *a, char *const *b, int *flag)
+static int cmp(char *const *a UNNEEDED, char *const *b UNNEEDED, int *flag UNNEEDED)
 {
 	return 0;
 }

+ 1 - 1
ccan/autodata/autodata.c

@@ -11,7 +11,7 @@ void *autodata_get_section(void *start, void *stop, size_t *nump)
 	return start;
 }
 
-void autodata_free(void *table)
+void autodata_free(void *table UNNEEDED)
 {
 }
 #else

+ 1 - 0
ccan/cast/test/compile_ok-static.c

@@ -6,5 +6,6 @@ static char *p = cast_const(char *, (const char *)"hello");
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 	return p[0] == argv[0][0];
 }

+ 2 - 0
ccan/check_type/test/compile_fail-check_type.c

@@ -2,6 +2,8 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
+	(void)argv;
 #ifdef FAIL
 	check_type(argc, char);
 #endif

+ 2 - 0
ccan/check_type/test/compile_fail-check_type_unsigned.c

@@ -2,6 +2,8 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
+	(void)argv;
 #ifdef FAIL
 #if HAVE_TYPEOF
 	check_type(argc, unsigned int);

+ 1 - 0
ccan/check_type/test/compile_fail-check_types_match.c

@@ -3,6 +3,7 @@
 int main(int argc, char *argv[])
 {
 	unsigned char x = argc;
+	(void)argv;
 #ifdef FAIL
 	check_types_match(argc, x);
 #endif

+ 1 - 0
ccan/check_type/test/run.c

@@ -5,6 +5,7 @@ int main(int argc, char *argv[])
 {
 	int x = 0, y = 0;
 
+	(void)argv;
 	plan_tests(9);
 
 	ok1(check_type(argc, int) == 0);

+ 1 - 1
ccan/compiler/_info

@@ -41,7 +41,7 @@
  *		va_end(ap);
  *	}
  *
- *	int main(int argc, char *argv[])
+ *	int main(int argc, char *argv[] UNNEEDED)
  *	{
  *		if (argc != 1) {
  *			logger(3, "Don't want %i arguments!\n", argc-1);

+ 3 - 1
ccan/compiler/test/compile_fail-printf.c

@@ -2,9 +2,11 @@
 
 static void PRINTF_FMT(2,3) my_printf(int x, const char *fmt, ...)
 {
+	(void)x;
+	(void)fmt;
 }
 
-int main(int argc, char *argv[])
+int main(void)
 {
 	unsigned int i = 0;
 

+ 2 - 0
ccan/compiler/test/run-is_compile_constant.c

@@ -3,6 +3,8 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
+	(void)argv;
 	plan_tests(2);
 
 	ok1(!IS_COMPILE_CONSTANT(argc));

+ 1 - 0
ccan/crypto/siphash24/siphash24.c

@@ -45,6 +45,7 @@ static void check_siphash24(struct siphash24_ctx *ctx)
 static bool alignment_ok(const void *p, size_t n)
 {
 #if HAVE_UNALIGNED_ACCESS
+	(void)p; (void)n;
 	return true;
 #else
 	return ((size_t)p % n == 0);

+ 1 - 0
ccan/err/test/run.c

@@ -15,6 +15,7 @@ int main(int argc, char *argv[])
 	int pfd[2];
 	const char *base;
 
+	(void)argc;
 	plan_tests(24);
 
 	err_set_progname(argv[0]);

+ 1 - 0
ccan/htable/_info

@@ -36,6 +36,7 @@
  *	// Wrapper for rehash function pointer.
  *	static size_t rehash(const void *e, void *unused)
  *	{
+ *		(void)unused;
  *		return hash_string(((struct name_to_digit *)e)->name);
  *	}
  *

+ 1 - 0
ccan/htable/htable.h

@@ -35,6 +35,7 @@ struct htable {
  *	// For simplicity's sake, say hash value is contents of elem.
  *	static size_t rehash(const void *elem, void *unused)
  *	{
+ *		(void)unused;
  *		return *(size_t *)elem;
  *	}
  *	static struct htable ht = HTABLE_INITIALIZER(ht, rehash, NULL);

+ 1 - 1
ccan/htable/test/run-copy.c

@@ -6,7 +6,7 @@
 
 #define NUM_VALS 512
 
-static size_t hash(const void *elem, void *unused)
+static size_t hash(const void *elem, void *unused UNNEEDED)
 {
 	size_t h = *(uint64_t *)elem / 2;
 	return h;

+ 1 - 1
ccan/htable/test/run-size.c

@@ -8,7 +8,7 @@
 
 /* We use the number divided by two as the hash (for lots of
    collisions). */
-static size_t hash(const void *elem, void *unused)
+static size_t hash(const void *elem, void *unused UNNEEDED)
 {
 	size_t h = *(uint64_t *)elem / 2;
 	return h;

+ 1 - 1
ccan/htable/test/run-type-int.c

@@ -88,7 +88,7 @@ static void del_vals(struct htable_obj *ht,
 }
 
 static void del_vals_bykey(struct htable_obj *ht,
-			   const struct obj val[], unsigned int num)
+			   const struct obj val[] UNNEEDED, unsigned int num)
 {
 	unsigned int i;
 

+ 1 - 1
ccan/htable/test/run-zero-hash-first-entry.c

@@ -8,7 +8,7 @@ struct data {
 };
 
 /* Hash is simply key itself. */
-static size_t hash(const void *e, void *unused)
+static size_t hash(const void *e, void *unused UNNEEDED)
 {
 	struct data *d = (struct data *)e;
 

+ 1 - 1
ccan/htable/test/run.c

@@ -10,7 +10,7 @@
 /* We use the number divided by two as the hash (for lots of
    collisions), plus set all the higher bits so we can detect if they
    don't get masked out. */
-static size_t hash(const void *elem, void *unused)
+static size_t hash(const void *elem, void *unused UNNEEDED)
 {
 	size_t h = *(uint64_t *)elem / 2;
 	h |= -1UL << NUM_BITS;

+ 2 - 1
ccan/list/test/run-CCAN_LIST_DEBUG.c

@@ -17,6 +17,7 @@ static int my_fprintf(FILE *stream, const char *format, ...)
 {
 	va_list ap;
 	int ret;
+	(void)stream;
 	va_start(ap, format);
 	ret = vsprintf(printf_buffer, format, ap);
 	va_end(ap);
@@ -44,7 +45,7 @@ int main(void)
 	list.n.prev = &n1;
 
 	/* Aborting version. */
-	sprintf(expect, "run-CCAN_LIST_DEBUG.c:50: prev corrupt in node %p (0) of %p\n",
+	sprintf(expect, "run-CCAN_LIST_DEBUG.c:51: prev corrupt in node %p (0) of %p\n",
 		&list, &list);
 	if (setjmp(aborted) == 0) {
 		assert(list_empty(&list));

+ 1 - 0
ccan/list/test/run-check-corrupt.c

@@ -16,6 +16,7 @@ static int my_fprintf(FILE *stream, const char *format, ...)
 {
 	va_list ap;
 	int ret;
+	(void)stream;
 	va_start(ap, format);
 	ret = vsprintf(printf_buffer, format, ap);
 	va_end(ap);

+ 1 - 0
ccan/mem/mem.h

@@ -250,6 +250,7 @@ static inline void *memcheck_(const void *data, size_t len)
 #else
 static inline void *memcheck_(const void *data, size_t len)
 {
+	(void)len;
 	return (void *)data;
 }
 #endif

+ 1 - 1
ccan/opt/opt.h

@@ -185,7 +185,7 @@ void opt_register_table(const struct opt_table *table, const char *desc);
  * string (or see opt_set_alloc) and return false.
  *
  * Example:
- * static char *explode(const char *optarg, void *unused)
+ * static char *explode(const char *optarg, void *unused UNNEEDED)
  * {
  *	errx(1, "BOOM! %s", optarg);
  * }

+ 2 - 2
ccan/opt/test/run-add_desc.c

@@ -4,13 +4,13 @@
 #include <ccan/opt/helpers.c>
 #include <ccan/opt/parse.c>
 
-static void show_10(char buf[OPT_SHOW_LEN], const void *arg)
+static void show_10(char buf[OPT_SHOW_LEN], const void *arg UNNEEDED)
 {
 	memset(buf, 'X', 10);
 	buf[10] = '\0';
 }
 
-static void show_max(char buf[OPT_SHOW_LEN], const void *arg)
+static void show_max(char buf[OPT_SHOW_LEN], const void *arg UNNEEDED)
 {
 	memset(buf, 'X', OPT_SHOW_LEN);
 }

+ 1 - 1
ccan/opt/test/run-helpers.c

@@ -52,7 +52,7 @@ static int saved_printf(const char *fmt, ...)
 	return ret;
 }
 
-static int saved_fprintf(FILE *ignored, const char *fmt, ...)
+static int saved_fprintf(FILE *ignored UNNEEDED, const char *fmt, ...)
 {
 	va_list ap;
 	int ret;

+ 3 - 3
ccan/opt/test/run-set_alloc.c

@@ -2,15 +2,15 @@
 #include <stdlib.h>
 
 /* Make sure we override these! */
-static void *no_malloc(size_t size)
+static void *no_malloc(size_t size UNNEEDED)
 {
 	abort();
 }
-static void *no_realloc(void *p, size_t size)
+static void *no_realloc(void *p UNNEEDED, size_t size UNNEEDED)
 {
 	abort();
 }
-static void no_free(void *p)
+static void no_free(void *p UNNEEDED)
 {
 	abort();
 }

+ 3 - 3
ccan/opt/test/run-usage.c

@@ -6,7 +6,7 @@
 #include "utils.h"
 
 /* Ensure width is sane. */
-static const char *getenv_override(const char *name)
+static const char *getenv_override(const char *name UNNEEDED)
 {
 	return "100";
 }
@@ -18,13 +18,13 @@ static const char *getenv_override(const char *name)
 #include <ccan/opt/helpers.c>
 #include <ccan/opt/parse.c>
 
-static char *my_cb(void *p)
+static char *my_cb(void *p UNNEEDED)
 {
 	return NULL;
 }
 
 /* Test helpers. */
-int main(int argc, char *argv[])
+int main(void)
 {
 	char *output;
 	char *longname = strdup("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

+ 1 - 1
ccan/opt/test/utils.c

@@ -8,7 +8,7 @@
 #include "utils.h"
 
 unsigned int test_cb_called;
-char *test_noarg(void *arg)
+char *test_noarg(void *arg UNNEEDED)
 {
 	test_cb_called++;
 	return NULL;

+ 2 - 1
ccan/order/order.c

@@ -24,7 +24,7 @@
 			   const _type *b,				\
 			   void *ctx)					\
 	{								\
-		return _order_##_oname(a, b, int2ptr(0));		\
+		(void)ctx; return _order_##_oname(a, b, int2ptr(0));	\
 	}								\
 	int _order_##_oname##_reverse(const void *a,			\
 				      const void *b,			\
@@ -36,6 +36,7 @@
 				     const _type *b,			\
 				     void *ctx)				\
 	{								\
+		(void)ctx;						\
 		return _order_##_oname##_reverse(a, b, int2ptr(0));	\
 	}								\
 	int order_##_oname##_noctx(const void *a,			\

+ 1 - 0
ccan/read_write_all/test/run-read_all.c

@@ -17,6 +17,7 @@ static int p2c[2], c2p[2];
 static void got_signal(int sig)
 {
 	char c = 0;
+	(void)sig;
 	if (write(p2c[1], &c, 1) == 1)
 		sigcount++;
 }

+ 3 - 0
ccan/read_write_all/test/run-write_all.c

@@ -19,6 +19,9 @@ static ssize_t write_return;
 
 static ssize_t test_write(int fd, const void *buf, size_t count)
 {
+	(void)fd;
+	(void)buf;
+
 	if (write_return == 0) {
 		errno = ENOSPC;
 		return 0;

+ 1 - 0
ccan/str/test/compile_fail-isalnum.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check isalnum.

+ 1 - 0
ccan/str/test/compile_fail-isalpha.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check isalpha.

+ 1 - 0
ccan/str/test/compile_fail-isascii.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check isascii.

+ 1 - 0
ccan/str/test/compile_fail-isblank.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF || !HAVE_ISBLANK
 #error We need typeof to check isblank.

+ 1 - 0
ccan/str/test/compile_fail-iscntrl.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check iscntrl.

+ 1 - 0
ccan/str/test/compile_fail-isdigit.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check isdigit.

+ 1 - 0
ccan/str/test/compile_fail-islower.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check islower.

+ 1 - 0
ccan/str/test/compile_fail-isprint.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check isprint.

+ 1 - 0
ccan/str/test/compile_fail-ispunct.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check ispunct.

+ 1 - 0
ccan/str/test/compile_fail-isspace.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check isspace.

+ 1 - 0
ccan/str/test/compile_fail-isupper.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check isupper.

+ 1 - 0
ccan/str/test/compile_fail-isxdigit.c

@@ -3,6 +3,7 @@
 
 int main(int argc, char *argv[])
 {
+	(void)argc;
 #ifdef FAIL
 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
 #error We need typeof to check isxdigit.

+ 2 - 1
ccan/strmap/_info

@@ -16,10 +16,11 @@
  *	license_depends_compat FAIL
  *
  * Example:
+ * #include <ccan/compiler/compiler.h>
  * #include <ccan/strmap/strmap.h>
  * #include <stdio.h>
  *
- * static bool dump(const char *member, size_t value, void *unused)
+ * static bool dump(const char *member, size_t value, void *unused UNNEEDED)
  * {
  * 	printf("%s at %zu. ", member, value);
  * 	// true means keep going with iteration.

+ 1 - 1
ccan/strmap/test/run-iterate-const.c

@@ -5,7 +5,7 @@
 static bool found = false;
 
 /* Make sure const args work. */
-static bool find_string(const char *str, char *member, const char *cmp)
+static bool find_string(const char *str UNNEEDED, char *member, const char *cmp)
 {
 	if (strcmp(member, cmp) == 0)
 		found = true;

+ 1 - 1
ccan/strmap/test/run-prefix.c

@@ -15,7 +15,7 @@ static bool in_order(const char *index, char *value, unsigned int *count)
 	return true;
 }
 
-static bool find_empty(const char *index, char *value, char *empty)
+static bool find_empty(const char *index, char *value UNNEEDED, char *empty)
 {
 	if (index == empty)
 		pass("Found empty entry!");

+ 1 - 1
ccan/take/test/run.c

@@ -15,7 +15,7 @@ static void *my_realloc(void *p, size_t len)
 #include <ccan/tap/tap.h>
 
 static int my_allocfail_called;
-static void my_allocfail(const void *p)
+static void my_allocfail(const void *p UNNEEDED)
 {
 	my_allocfail_called++;
 }	

+ 1 - 1
ccan/tal/link/link.c

@@ -15,7 +15,7 @@ struct link {
 
 static void linkable_notifier(tal_t *linkable,
 			      enum tal_notify_type type,
-			      void *info)
+			      void *info UNNEEDED)
 {
 	struct linkable *l = tal_parent(linkable);
 	assert(type == TAL_NOTIFY_STEAL || type == TAL_NOTIFY_FREE);

+ 1 - 1
ccan/tal/link/test/run.c

@@ -4,7 +4,7 @@
 #include <err.h>
 
 static unsigned int destroy_count = 0;
-static void destroy_obj(void *obj)
+static void destroy_obj(void *obj UNNEEDED)
 {
 	destroy_count++;
 }

+ 1 - 0
ccan/tal/str/str.h

@@ -171,6 +171,7 @@ char *tal_strjoin(const void *ctx, char *strings[], const char *delim,
  *	{
  *		char *person, *input;
  *
+ *		(void)argc;
  *		// Join args and trim trailing space.
  *		input = tal_strjoin(NULL, argv+1, " ", STR_NO_TRAIL);
  *		if (tal_strreg(NULL, input,

+ 1 - 1
ccan/tal/tal.c

@@ -323,7 +323,7 @@ static struct name *add_name_property(struct tal_hdr *t, const char *name)
 }
 
 static struct children *add_child_property(struct tal_hdr *parent,
-					   struct tal_hdr *child)
+					   struct tal_hdr *child UNNEEDED)
 {
 	struct children *prop = allocate(sizeof(*prop));
 	if (prop) {

+ 1 - 1
ccan/tal/test/run-allocfail.c

@@ -30,7 +30,7 @@ static void nofail_on_error(const char *msg)
 	err_count++;
 }
 
-static void destroy_p(void *p)
+static void destroy_p(void *p UNNEEDED)
 {
 }
 

+ 1 - 1
ccan/tal/test/run-destructor.c

@@ -24,7 +24,7 @@ static void destroy_child(char *p)
 	destroy_count++;
 }
 
-static void destroy_inc(char *p)
+static void destroy_inc(char *p UNNEEDED)
 {
 	destroy_count++;
 }

+ 1 - 1
ccan/tal/test/run-free.c

@@ -2,7 +2,7 @@
 #include <ccan/tal/tal.c>
 #include <ccan/tap/tap.h>
 
-static void destroy_errno(char *p)
+static void destroy_errno(char *p UNNEEDED)
 {
 	errno = ENOENT;
 }

+ 4 - 2
ccan/tal/test/run-notifier.c

@@ -20,7 +20,7 @@ static void *my_realloc(void *old, size_t size)
 	return new;
 }
 
-static void notify1(char *p, enum tal_notify_type notify, void *info)
+static void notify1(char *p UNNEEDED, enum tal_notify_type notify, void *info)
 {
 	ok1(ctx == ctx);
 	ok1(notify == expect);
@@ -31,7 +31,9 @@ static void notify1(char *p, enum tal_notify_type notify, void *info)
 	notified1++;
 }
 
-static void notify2(char *ctx, enum tal_notify_type notify, void *info)
+static void notify2(char *ctx UNNEEDED,
+		    enum tal_notify_type notify UNNEEDED,
+		    void *info UNNEEDED)
 {
 	notified2++;
 }

+ 1 - 1
ccan/tal/test/run-overflow.c

@@ -4,7 +4,7 @@
 
 static int error_count;
 
-static void my_error(const char *msg)
+static void my_error(const char *msg UNNEEDED)
 {
 	error_count++;
 }

+ 1 - 1
ccan/tal/test/run-test-backend.c

@@ -31,7 +31,7 @@ static void *my_realloc(void *old, size_t new_size)
 
 #define NUM_ALLOCS 1000
 
-static void destroy_p(void *p)
+static void destroy_p(void *p UNNEEDED)
 {
 }
 

+ 1 - 0
ccan/tcon/test/compile_ok-void.c

@@ -15,6 +15,7 @@ int main(int argc, char *argv[])
 	struct void_container vcon;
 	TCON_WRAP(struct container, void *canary) vconw;
 
+	(void)argc;
 	tcon_check(&vcon, canary, NULL)->raw.p = NULL;
 	tcon_check(&vcon, canary, argv[0])->raw.p = NULL;
 	tcon_check(&vcon, canary, main)->raw.p = NULL;

+ 1 - 0
ccan/tcon/test/compile_ok.c

@@ -23,6 +23,7 @@ int main(int argc, char *argv[])
 	TCON_WRAP(struct container, int tc) iconw;
 	TCON_WRAP(struct container, int tc1; char *tc2) ciconw;
 
+	(void)argc;
 	tcon_check(&icon, tc, 7)->raw.p = NULL;
 	tcon_check(&cicon, tc1, 7)->raw.p = argv[0];
 	tcon_check(&cicon, tc2, argv[0])->raw.p = argv[0];

+ 1 - 0
ccan/timer/_info

@@ -31,6 +31,7 @@
  *		struct timer *t;
  *		struct timed_string *s;
  *
+ *		(void)argc;
  *		timers_init(&timers, time_mono());
  *		list_head_init(&strings);
  *

+ 1 - 1
ccan/timer/timer.c

@@ -114,7 +114,7 @@ void timer_addmono(struct timers *timers, struct timer *t, struct timemono when)
 }
 
 /* FIXME: inline */
-void timer_del(struct timers *timers, struct timer *t)
+void timer_del(struct timers *timers UNNEEDED, struct timer *t)
 {
 	list_del_init(&t->list);
 }

+ 1 - 0
ccan/typesafe_cb/test/compile_fail-cast_if_type-promotable.c

@@ -3,6 +3,7 @@
 
 static void _set_some_value(void *val)
 {
+	(void)val;
 }
 
 #define set_some_value(expr)						\

+ 1 - 0
ccan/typesafe_cb/test/compile_fail-typesafe_cb-int.c

@@ -15,6 +15,7 @@ void _callback(void (*fn)(void *arg), void *arg)
 void my_callback(int something);
 void my_callback(int something)
 {
+	(void)something;
 }
 
 int main(void)

+ 3 - 0
ccan/typesafe_cb/test/compile_fail-typesafe_cb.c

@@ -3,6 +3,8 @@
 
 static void _register_callback(void (*cb)(void *arg), void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 
 #define register_callback(cb, arg)				\
@@ -10,6 +12,7 @@ static void _register_callback(void (*cb)(void *arg), void *arg)
 
 static void my_callback(char *p)
 {
+	(void)p;
 }
 
 int main(void)

+ 1 - 0
ccan/typesafe_cb/test/compile_fail-typesafe_cb_cast-multi.c

@@ -23,6 +23,7 @@ struct other {
 
 static void take_any(struct any *any)
 {
+	(void)any;
 }
 
 int main(void)

+ 1 - 0
ccan/typesafe_cb/test/compile_fail-typesafe_cb_cast.c

@@ -4,6 +4,7 @@ void _set_some_value(void *val);
 
 void _set_some_value(void *val)
 {
+	(void)val;
 }
 
 #define set_some_value(expr)						\

+ 4 - 0
ccan/typesafe_cb/test/compile_fail-typesafe_cb_postargs.c

@@ -3,12 +3,16 @@
 
 static void _register_callback(void (*cb)(void *arg, int x), void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 #define register_callback(cb, arg)				\
 	_register_callback(typesafe_cb_postargs(void, void *, (cb), (arg), int), (arg))
 
 static void my_callback(char *p, int x)
 {
+	(void)p;
+	(void)x;
 }
 
 int main(void)

+ 4 - 0
ccan/typesafe_cb/test/compile_fail-typesafe_cb_preargs.c

@@ -3,6 +3,8 @@
 
 static void _register_callback(void (*cb)(int x, void *arg), void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 
 #define register_callback(cb, arg)				\
@@ -10,6 +12,8 @@ static void _register_callback(void (*cb)(int x, void *arg), void *arg)
 
 static void my_callback(int x, char *p)
 {
+	(void)p;
+	(void)x;
 }
 
 int main(void)

+ 2 - 0
ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c

@@ -5,6 +5,8 @@
 
 static void _register_callback(void (*cb)(const void *arg), const void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 
 #define register_callback(cb, arg)				\

+ 11 - 0
ccan/typesafe_cb/test/compile_ok-typesafe_cb-undefined.c

@@ -5,6 +5,8 @@
 
 static void _register_callback(void (*cb)(void *arg), void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 
 #define register_callback(cb, arg)				\
@@ -12,6 +14,8 @@ static void _register_callback(void (*cb)(void *arg), void *arg)
 
 static void _register_callback_pre(void (*cb)(int x, void *arg), void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 
 #define register_callback_pre(cb, arg)					\
@@ -19,6 +23,8 @@ static void _register_callback_pre(void (*cb)(int x, void *arg), void *arg)
 
 static void _register_callback_post(void (*cb)(void *arg, int x), void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 
 #define register_callback_post(cb, arg)					\
@@ -28,14 +34,19 @@ struct undefined;
 
 static void my_callback(struct undefined *undef)
 {
+	(void)undef;
 }
 
 static void my_callback_pre(int x, struct undefined *undef)
 {
+	(void)x;
+	(void)undef;
 }
 
 static void my_callback_post(struct undefined *undef, int x)
 {
+	(void)undef;
+	(void)x;
 }
 
 int main(void)

+ 11 - 0
ccan/typesafe_cb/test/compile_ok-typesafe_cb-vars.c

@@ -5,6 +5,8 @@
 
 static void _register_callback(void (*cb)(void *arg), void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 
 #define register_callback(cb, arg)				\
@@ -12,6 +14,8 @@ static void _register_callback(void (*cb)(void *arg), void *arg)
 
 static void _register_callback_pre(void (*cb)(int x, void *arg), void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 
 #define register_callback_pre(cb, arg)					\
@@ -19,6 +23,8 @@ static void _register_callback_pre(void (*cb)(int x, void *arg), void *arg)
 
 static void _register_callback_post(void (*cb)(void *arg, int x), void *arg)
 {
+	(void)cb;
+	(void)arg;
 }
 
 #define register_callback_post(cb, arg)					\
@@ -28,14 +34,19 @@ struct undefined;
 
 static void my_callback(struct undefined *undef)
 {
+	(void)undef;
 }
 
 static void my_callback_pre(int x, struct undefined *undef)
 {
+	(void)x;
+	(void)undef;
 }
 
 static void my_callback_post(struct undefined *undef, int x)
 {
+	(void)x;
+	(void)undef;
 }
 
 int main(void)

+ 1 - 0
ccan/typesafe_cb/test/compile_ok-typesafe_cb_cast.c

@@ -19,6 +19,7 @@ struct any {
 
 static void take_any(struct any *any)
 {
+	(void)any;
 }
 
 int main(void)