int main(int argc, char *argv[8])
{
+ (void)argc;
+ (void)argv;
char array[100];
#ifdef FAIL
return ARRAY_SIZE(argv) + ARRAY_SIZE(array);
#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;
}
return start;
}
-void autodata_free(void *table)
+void autodata_free(void *table UNNEEDED)
{
}
#else
int main(int argc, char *argv[])
{
+ (void)argc;
return p[0] == argv[0][0];
}
int main(int argc, char *argv[])
{
+ (void)argc;
+ (void)argv;
#ifdef FAIL
check_type(argc, char);
#endif
int main(int argc, char *argv[])
{
+ (void)argc;
+ (void)argv;
#ifdef FAIL
#if HAVE_TYPEOF
check_type(argc, unsigned int);
int main(int argc, char *argv[])
{
unsigned char x = argc;
+ (void)argv;
#ifdef FAIL
check_types_match(argc, x);
#endif
{
int x = 0, y = 0;
+ (void)argv;
plan_tests(9);
ok1(check_type(argc, int) == 0);
* 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);
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;
int main(int argc, char *argv[])
{
+ (void)argc;
+ (void)argv;
plan_tests(2);
ok1(!IS_COMPILE_CONSTANT(argc));
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);
int pfd[2];
const char *base;
+ (void)argc;
plan_tests(24);
err_set_progname(argv[0]);
* // 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);
* }
*
* // 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);
#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;
/* 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;
}
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;
};
/* 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;
/* 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;
{
va_list ap;
int ret;
+ (void)stream;
va_start(ap, format);
ret = vsprintf(printf_buffer, format, ap);
va_end(ap);
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));
{
va_list ap;
int ret;
+ (void)stream;
va_start(ap, format);
ret = vsprintf(printf_buffer, format, ap);
va_end(ap);
#else
static inline void *memcheck_(const void *data, size_t len)
{
+ (void)len;
return (void *)data;
}
#endif
* 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);
* }
#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);
}
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;
#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();
}
#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";
}
#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");
#include "utils.h"
unsigned int test_cb_called;
-char *test_noarg(void *arg)
+char *test_noarg(void *arg UNNEEDED)
{
test_cb_called++;
return NULL;
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, \
const _type *b, \
void *ctx) \
{ \
+ (void)ctx; \
return _order_##_oname##_reverse(a, b, int2ptr(0)); \
} \
int order_##_oname##_noctx(const void *a, \
static void got_signal(int sig)
{
char c = 0;
+ (void)sig;
if (write(p2c[1], &c, 1) == 1)
sigcount++;
}
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;
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
* 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.
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;
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!");
#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++;
}
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);
#include <err.h>
static unsigned int destroy_count = 0;
-static void destroy_obj(void *obj)
+static void destroy_obj(void *obj UNNEEDED)
{
destroy_count++;
}
* {
* 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,
}
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) {
err_count++;
}
-static void destroy_p(void *p)
+static void destroy_p(void *p UNNEEDED)
{
}
destroy_count++;
}
-static void destroy_inc(char *p)
+static void destroy_inc(char *p UNNEEDED)
{
destroy_count++;
}
#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;
}
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);
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++;
}
static int error_count;
-static void my_error(const char *msg)
+static void my_error(const char *msg UNNEEDED)
{
error_count++;
}
#define NUM_ALLOCS 1000
-static void destroy_p(void *p)
+static void destroy_p(void *p UNNEEDED)
{
}
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;
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];
* struct timer *t;
* struct timed_string *s;
*
+ * (void)argc;
* timers_init(&timers, time_mono());
* list_head_init(&strings);
*
}
/* 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);
}
static void _set_some_value(void *val)
{
+ (void)val;
}
#define set_some_value(expr) \
void my_callback(int something);
void my_callback(int something)
{
+ (void)something;
}
int main(void)
static void _register_callback(void (*cb)(void *arg), void *arg)
{
+ (void)cb;
+ (void)arg;
}
#define register_callback(cb, arg) \
static void my_callback(char *p)
{
+ (void)p;
}
int main(void)
static void take_any(struct any *any)
{
+ (void)any;
}
int main(void)
void _set_some_value(void *val)
{
+ (void)val;
}
#define set_some_value(expr) \
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)
static void _register_callback(void (*cb)(int x, void *arg), void *arg)
{
+ (void)cb;
+ (void)arg;
}
#define register_callback(cb, arg) \
static void my_callback(int x, char *p)
{
+ (void)p;
+ (void)x;
}
int main(void)
static void _register_callback(void (*cb)(const void *arg), const void *arg)
{
+ (void)cb;
+ (void)arg;
}
#define register_callback(cb, arg) \
static void _register_callback(void (*cb)(void *arg), void *arg)
{
+ (void)cb;
+ (void)arg;
}
#define register_callback(cb, arg) \
static void _register_callback_pre(void (*cb)(int x, void *arg), void *arg)
{
+ (void)cb;
+ (void)arg;
}
#define register_callback_pre(cb, arg) \
static void _register_callback_post(void (*cb)(void *arg, int x), void *arg)
{
+ (void)cb;
+ (void)arg;
}
#define register_callback_post(cb, arg) \
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)
static void _register_callback(void (*cb)(void *arg), void *arg)
{
+ (void)cb;
+ (void)arg;
}
#define register_callback(cb, arg) \
static void _register_callback_pre(void (*cb)(int x, void *arg), void *arg)
{
+ (void)cb;
+ (void)arg;
}
#define register_callback_pre(cb, arg) \
static void _register_callback_post(void (*cb)(void *arg, int x), void *arg)
{
+ (void)cb;
+ (void)arg;
}
#define register_callback_post(cb, arg) \
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)
static void take_any(struct any *any)
{
+ (void)any;
}
int main(void)