Commit e7e57cbf authored by Rusty Russell's avatar Rusty Russell

Remove unused main() args in many modules.

This makes us closer to compiling cleanly with -Wunused (as used by -Wextra).
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent c3a3b745
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* *
* // Output contains "ALIGNOF(char) == 1" * // Output contains "ALIGNOF(char) == 1"
* // Will also print out whether an onstack char array can hold a long. * // Will also print out whether an onstack char array can hold a long.
* int main(int argc, char *argv[]) * int main(void)
* { * {
* char arr[sizeof(int)]; * char arr[sizeof(int)];
* *
......
...@@ -24,7 +24,7 @@ struct lots_of_types ...@@ -24,7 +24,7 @@ struct lots_of_types
char c5; char c5;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct lots_of_types lots_of_types, *lp = malloc(sizeof(*lp)); struct lots_of_types lots_of_types, *lp = malloc(sizeof(*lp));
char c; char c;
......
...@@ -18,7 +18,7 @@ int check_parameter(const struct foo *array) ...@@ -18,7 +18,7 @@ int check_parameter(const struct foo *array)
#endif #endif
} }
int main(int argc, char *argv[]) int main(void)
{ {
return check_parameter(NULL); return check_parameter(NULL);
} }
...@@ -16,7 +16,7 @@ static int array2_size = ARRAY_SIZE(array2); ...@@ -16,7 +16,7 @@ static int array2_size = ARRAY_SIZE(array2);
static int array3_size = ARRAY_SIZE(array3); static int array3_size = ARRAY_SIZE(array3);
static int array4_size = ARRAY_SIZE(array4); static int array4_size = ARRAY_SIZE(array4);
int main(int argc, char *argv[]) int main(void)
{ {
plan_tests(8); plan_tests(8);
ok1(array1_size == 1); ok1(array1_size == 1);
......
#include <ccan/build_assert/build_assert.h> #include <ccan/build_assert/build_assert.h>
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
return BUILD_ASSERT_OR_ZERO(1 == 0); return BUILD_ASSERT_OR_ZERO(1 == 0);
......
#include <ccan/build_assert/build_assert.h> #include <ccan/build_assert/build_assert.h>
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
BUILD_ASSERT(1 == 0); BUILD_ASSERT(1 == 0);
......
#include <ccan/build_assert/build_assert.h> #include <ccan/build_assert/build_assert.h>
int main(int argc, char *argv[]) int main(void)
{ {
BUILD_ASSERT(1 == 1); BUILD_ASSERT(1 == 1);
return 0; return 0;
......
#include <ccan/build_assert/build_assert.h> #include <ccan/build_assert/build_assert.h>
#include <ccan/tap/tap.h> #include <ccan/tap/tap.h>
int main(int argc, char *argv[]) int main(void)
{ {
plan_tests(1); plan_tests(1);
ok1(BUILD_ASSERT_OR_ZERO(1 == 1) == 0); ok1(BUILD_ASSERT_OR_ZERO(1 == 1) == 0);
......
...@@ -6,7 +6,7 @@ struct char_struct { ...@@ -6,7 +6,7 @@ struct char_struct {
char c; char c;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
char *uc; char *uc;
const const
......
...@@ -6,7 +6,7 @@ struct char_struct { ...@@ -6,7 +6,7 @@ struct char_struct {
char c; char c;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
char **uc; char **uc;
const const
......
...@@ -6,7 +6,7 @@ struct char_struct { ...@@ -6,7 +6,7 @@ struct char_struct {
char c; char c;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
char ***uc; char ***uc;
const const
......
#include <ccan/cast/cast.h> #include <ccan/cast/cast.h>
#include <stdlib.h> #include <stdlib.h>
int main(int argc, char *argv[]) int main(void)
{ {
unsigned char *uc; unsigned char *uc;
#ifdef FAIL #ifdef FAIL
......
...@@ -6,7 +6,7 @@ struct char_struct { ...@@ -6,7 +6,7 @@ struct char_struct {
char c; char c;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
unsigned char *uc; unsigned char *uc;
#ifdef FAIL #ifdef FAIL
......
#include <ccan/cast/cast.h> #include <ccan/cast/cast.h>
#include <stdlib.h> #include <stdlib.h>
int main(int argc, char *argv[]) int main(void)
{ {
unsigned char *uc; unsigned char *uc;
#ifdef FAIL #ifdef FAIL
......
#include <ccan/cast/cast.h> #include <ccan/cast/cast.h>
#include <stdlib.h> #include <stdlib.h>
int main(int argc, char *argv[]) int main(void)
{ {
char *c; char *c;
#ifdef FAIL #ifdef FAIL
......
#include <ccan/cast/cast.h> #include <ccan/cast/cast.h>
#include <stdlib.h> #include <stdlib.h>
int main(int argc, char *argv[]) int main(void)
{ {
char *c; char *c;
#ifdef FAIL #ifdef FAIL
......
#include <ccan/cast/cast.h> #include <ccan/cast/cast.h>
#include <stdlib.h> #include <stdlib.h>
int main(int argc, char *argv[]) int main(void)
{ {
long c; long c;
#ifdef FAIL #ifdef FAIL
......
...@@ -6,7 +6,7 @@ struct foo { ...@@ -6,7 +6,7 @@ struct foo {
char b; char b;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct foo foo = { .a = 1, .b = 2 }; struct foo foo = { .a = 1, .b = 2 };
int *intp = &foo.a; int *intp = &foo.a;
......
...@@ -6,7 +6,7 @@ struct foo { ...@@ -6,7 +6,7 @@ struct foo {
char b; char b;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct foo foo = { .a = 1, .b = 2 }, *foop; struct foo foo = { .a = 1, .b = 2 }, *foop;
int *intp = &foo.a; int *intp = &foo.a;
......
...@@ -6,7 +6,7 @@ struct foo { ...@@ -6,7 +6,7 @@ struct foo {
char b; char b;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct foo foo = { .a = 1, .b = 2 }, *foop; struct foo foo = { .a = 1, .b = 2 }, *foop;
int *intp = &foo.a; int *intp = &foo.a;
......
...@@ -6,7 +6,7 @@ struct foo { ...@@ -6,7 +6,7 @@ struct foo {
char b; char b;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct foo foo = { .a = 1, .b = 2 }; struct foo foo = { .a = 1, .b = 2 };
int *intp = &foo.a; int *intp = &foo.a;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <stddef.h> #include <stddef.h>
#include <ccan/tap/tap.h> #include <ccan/tap/tap.h>
int main(int argc, char *argv[]) int main(void)
{ {
union { union {
uint64_t u64; uint64_t u64;
......
...@@ -17,7 +17,7 @@ static bool cmp(const void *candidate, void *ptr) ...@@ -17,7 +17,7 @@ static bool cmp(const void *candidate, void *ptr)
return *(const uint64_t *)candidate == *(const uint64_t *)ptr; return *(const uint64_t *)candidate == *(const uint64_t *)ptr;
} }
int main(int argc, char *argv[]) int main(void)
{ {
struct htable ht, ht2; struct htable ht, ht2;
uint64_t val[NUM_VALS], i; uint64_t val[NUM_VALS], i;
......
...@@ -14,7 +14,7 @@ static size_t hash(const void *elem, void *unused) ...@@ -14,7 +14,7 @@ static size_t hash(const void *elem, void *unused)
return h; return h;
} }
int main(int argc, char *argv[]) int main(void)
{ {
struct htable ht; struct htable ht;
uint64_t val[NUM_VALS]; uint64_t val[NUM_VALS];
......
...@@ -112,7 +112,7 @@ static bool check_mask(struct htable *ht, const struct obj val[], unsigned num) ...@@ -112,7 +112,7 @@ static bool check_mask(struct htable *ht, const struct obj val[], unsigned num)
return true; return true;
} }
int main(int argc, char *argv[]) int main(void)
{ {
unsigned int i; unsigned int i;
struct htable_obj ht, ht2; struct htable_obj ht, ht2;
......
...@@ -107,7 +107,7 @@ static bool check_mask(struct htable *ht, const struct obj val[], unsigned num) ...@@ -107,7 +107,7 @@ static bool check_mask(struct htable *ht, const struct obj val[], unsigned num)
return true; return true;
} }
int main(int argc, char *argv[]) int main(void)
{ {
unsigned int i; unsigned int i;
struct htable_obj ht, ht2; struct htable_obj ht, ht2;
......
...@@ -95,7 +95,7 @@ static bool check_mask(struct htable *ht, uint64_t val[], unsigned num) ...@@ -95,7 +95,7 @@ static bool check_mask(struct htable *ht, uint64_t val[], unsigned num)
return true; return true;
} }
int main(int argc, char *argv[]) int main(void)
{ {
unsigned int i, weight; unsigned int i, weight;
uintptr_t perfect_bit; uintptr_t perfect_bit;
......
...@@ -19,7 +19,7 @@ static int test_ilog64(uint64_t _v){ ...@@ -19,7 +19,7 @@ static int test_ilog64(uint64_t _v){
#define NTRIALS (64) #define NTRIALS (64)
int main(int _argc,const char *_argv[]){ int main(void){
int i; int i;
int j; int j;
int (*il32)(uint32_t) = ilog32; int (*il32)(uint32_t) = ilog32;
......
...@@ -19,7 +19,7 @@ static int test_ilog64(uint64_t _v){ ...@@ -19,7 +19,7 @@ static int test_ilog64(uint64_t _v){
#define NTRIALS (64) #define NTRIALS (64)
int main(int _argc,const char *_argv[]){ int main(void){
int i; int i;
int j; int j;
/*This is how many tests you plan to run.*/ /*This is how many tests you plan to run.*/
......
...@@ -134,7 +134,7 @@ static const uint32_t STATEVEC[ISAAC_SZ<<1]={ ...@@ -134,7 +134,7 @@ static const uint32_t STATEVEC[ISAAC_SZ<<1]={
0x46D95CA5, 0xC54CD95B, 0x9D855E89, 0x4BB5AF29 0x46D95CA5, 0xC54CD95B, 0x9D855E89, 0x4BB5AF29
}; };
int main(int _argc,const char *_argv[]){ int main(void){
isaac_ctx isaac; isaac_ctx isaac;
int i; int i;
int j; int j;
......
...@@ -262,7 +262,7 @@ static const uint64_t STATEVEC64[ISAAC64_SZ<<1]={ ...@@ -262,7 +262,7 @@ static const uint64_t STATEVEC64[ISAAC64_SZ<<1]={
0x1877B51E57A764D5ULL, 0x001F837CC7350524ULL 0x1877B51E57A764D5ULL, 0x001F837CC7350524ULL
}; };
int main(int _argc,const char *_argv[]){ int main(void){
isaac64_ctx isaac64; isaac64_ctx isaac64;
int i; int i;
int j; int j;
......
...@@ -26,7 +26,7 @@ static bool likely_one_unlikely_two(unsigned int val1, unsigned int val2) ...@@ -26,7 +26,7 @@ static bool likely_one_unlikely_two(unsigned int val1, unsigned int val2)
return false; return false;
} }
int main(int argc, char *argv[]) int main(void)
{ {
char *bad; char *bad;
......
...@@ -17,7 +17,7 @@ static bool one_seems_unlikely(unsigned int val) ...@@ -17,7 +17,7 @@ static bool one_seems_unlikely(unsigned int val)
return false; return false;
} }
int main(int argc, char *argv[]) int main(void)
{ {
plan_tests(4); plan_tests(4);
......
...@@ -28,7 +28,7 @@ static int my_fprintf(FILE *stream, const char *format, ...) ...@@ -28,7 +28,7 @@ static int my_fprintf(FILE *stream, const char *format, ...)
#include <ccan/tap/tap.h> #include <ccan/tap/tap.h>
#include <ccan/list/list.c> #include <ccan/list/list.c>
int main(int argc, char *argv[]) int main(void)
{ {
struct list_head list; struct list_head list;
struct list_node n1; struct list_node n1;
......
...@@ -26,7 +26,7 @@ static int my_fprintf(FILE *stream, const char *format, ...) ...@@ -26,7 +26,7 @@ static int my_fprintf(FILE *stream, const char *format, ...)
#include <ccan/tap/tap.h> #include <ccan/tap/tap.h>
#include <ccan/list/list.c> #include <ccan/list/list.c>
int main(int argc, char *argv[]) int main(void)
{ {
struct list_head list; struct list_head list;
struct list_node n1; struct list_node n1;
......
...@@ -8,7 +8,7 @@ struct child { ...@@ -8,7 +8,7 @@ struct child {
struct list_node list; struct list_node list;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct child c1, c2; struct child c1, c2;
struct list_head list = LIST_HEAD_INIT(list); struct list_head list = LIST_HEAD_INIT(list);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
int main(int argc, char *argv[]) int main(void)
{ {
struct list_head list1, list2; struct list_head list1, list2;
struct list_node n1, n2, n3; struct list_node n1, n2, n3;
......
...@@ -14,7 +14,7 @@ struct child { ...@@ -14,7 +14,7 @@ struct child {
struct list_node list; struct list_node list;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct parent parent; struct parent parent;
struct child c1, c2, c3; struct child c1, c2, c3;
......
...@@ -17,7 +17,7 @@ static bool list_expect(struct list_head *h, ...) ...@@ -17,7 +17,7 @@ static bool list_expect(struct list_head *h, ...)
return (n->next == &h->n); return (n->next == &h->n);
} }
int main(int argc, char *argv[]) int main(void)
{ {
struct list_head h1, h2; struct list_head h1, h2;
struct list_node n[4]; struct list_node n[4];
......
...@@ -19,7 +19,7 @@ static LIST_HEAD(static_list); ...@@ -19,7 +19,7 @@ static LIST_HEAD(static_list);
#define ref(obj, counter) ((counter)++, (obj)) #define ref(obj, counter) ((counter)++, (obj))
int main(int argc, char *argv[]) int main(void)
{ {
struct parent parent; struct parent parent;
struct child c1, c2, c3, *c, *n; struct child c1, c2, c3, *c, *n;
......
...@@ -16,7 +16,7 @@ struct child { ...@@ -16,7 +16,7 @@ struct child {
static LIST_HEAD(static_list); static LIST_HEAD(static_list);
int main(int argc, char *argv[]) int main(void)
{ {
struct parent parent; struct parent parent;
struct child c1, c2, c3, x1, *c, *n; struct child c1, c2, c3, x1, *c, *n;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <assert.h> #include <assert.h>
int main(int argc, char *argv[]) int main(void)
{ {
const char *name = "noerr.file"; const char *name = "noerr.file";
int fd; int fd;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <ccan/opt/parse.c> #include <ccan/opt/parse.c>
#include <ccan/opt/usage.c> #include <ccan/opt/usage.c>
int main(int argc, char *argv[]) int main(void)
{ {
opt_register_noarg("-v", opt_version_and_exit, opt_register_noarg("-v", opt_version_and_exit,
(const char *)"1.2.3", (const char *)"1.2.3",
......
...@@ -16,7 +16,7 @@ static void show_max(char buf[OPT_SHOW_LEN], const void *arg) ...@@ -16,7 +16,7 @@ static void show_max(char buf[OPT_SHOW_LEN], const void *arg)
} }
/* Test add_desc helper. */ /* Test add_desc helper. */
int main(int argc, char *argv[]) int main(void)
{ {
struct opt_table opt; struct opt_table opt;
char *ret; char *ret;
......
...@@ -53,7 +53,7 @@ static void reset(void) ...@@ -53,7 +53,7 @@ static void reset(void)
opt_count = opt_num_short = opt_num_short_arg = opt_num_long = 0; opt_count = opt_num_short = opt_num_short_arg = opt_num_long = 0;
} }
int main(int argc, char *argv[]) int main(void)
{ {
int exitval; int exitval;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <ccan/opt/parse.c> #include <ccan/opt/parse.c>
/* Test consume_words helper. */ /* Test consume_words helper. */
int main(int argc, char *argv[]) int main(void)
{ {
size_t prefix, len; size_t prefix, len;
bool start = true; bool start = true;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <ccan/opt/parse.c> #include <ccan/opt/parse.c>
/* Test iterators. */ /* Test iterators. */
int main(int argc, char *argv[]) int main(void)
{ {
unsigned j, i, len = 0; unsigned j, i, len = 0;
const char *p; const char *p;
......
...@@ -12,7 +12,7 @@ typedef int item_t; ...@@ -12,7 +12,7 @@ typedef int item_t;
typedef struct item item_t; typedef struct item item_t;
#endif #endif
int main(int argc, char *argv[]) int main(void)
{ {
total_order_cb(cb0, struct item, struct cmp_info *) = fancy_cmp; total_order_cb(cb0, struct item, struct cmp_info *) = fancy_cmp;
_total_order_cb cb1 = total_order_cast(fancy_cmp, _total_order_cb cb1 = total_order_cast(fancy_cmp,
......
...@@ -12,7 +12,7 @@ typedef int ctx_t; ...@@ -12,7 +12,7 @@ typedef int ctx_t;
typedef struct cmp_info ctx_t; typedef struct cmp_info ctx_t;
#endif #endif
int main(int argc, char *argv[]) int main(void)
{ {
total_order_cb(cb0, struct item, struct cmp_info *) = fancy_cmp; total_order_cb(cb0, struct item, struct cmp_info *) = fancy_cmp;
_total_order_cb cb1 = total_order_cast(fancy_cmp, struct item, _total_order_cb cb1 = total_order_cast(fancy_cmp, struct item,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "fancy_cmp.h" #include "fancy_cmp.h"
int main(int argc, char *argv[]) int main(void)
{ {
total_order_cb(cb0, struct item, struct cmp_info *) = fancy_cmp; total_order_cb(cb0, struct item, struct cmp_info *) = fancy_cmp;
_total_order_cb cb1 = total_order_cast(fancy_cmp, _total_order_cb cb1 = total_order_cast(fancy_cmp,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "fancy_cmp.h" #include "fancy_cmp.h"
int main(int argc, char *argv[]) int main(void)
{ {
struct item item1 = { struct item item1 = {
.value = 0, .value = 0,
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* *
* void (*cb)(void *opaque) = callback; * void (*cb)(void *opaque) = callback;
* *
* int main(int argc, char *argv[]) * int main(void)
* { * {
* int val = 17; * int val = 17;
* *
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* #include <ccan/read_write_all/read_write_all.h> * #include <ccan/read_write_all/read_write_all.h>
* *
* #define BUFFER_SIZE 10 * #define BUFFER_SIZE 10
* int main(int argc, char *argv[]) * int main(void)
* { * {
* char buffer[BUFFER_SIZE+1]; * char buffer[BUFFER_SIZE+1];
* *
......
...@@ -24,7 +24,7 @@ static void got_signal(int sig) ...@@ -24,7 +24,7 @@ static void got_signal(int sig)
/* < PIPE_BUF *will* be atomic. But > PIPE_BUF only *might* be non-atomic. */ /* < PIPE_BUF *will* be atomic. But > PIPE_BUF only *might* be non-atomic. */
#define BUFSZ (1024*1024) #define BUFSZ (1024*1024)
int main(int argc, char *argv[]) int main(void)
{ {
char *buffer; char *buffer;
char c = 0; char c = 0;
......
...@@ -39,7 +39,7 @@ static ssize_t test_write(int fd, const void *buf, size_t count) ...@@ -39,7 +39,7 @@ static ssize_t test_write(int fd, const void *buf, size_t count)
#define BUFSZ 1024 #define BUFSZ 1024
int main(int argc, char *argv[]) int main(void)
{ {
char *buffer; char *buffer;
......
...@@ -4,7 +4,7 @@ struct s { ...@@ -4,7 +4,7 @@ struct s {
int val; int val;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct s struct s
#ifdef FAIL #ifdef FAIL
......
#define CCAN_STR_DEBUG 1 #define CCAN_STR_DEBUG 1
#include <ccan/str/str.h> #include <ccan/str/str.h>
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
#if !HAVE_TYPEOF #if !HAVE_TYPEOF
......
#define CCAN_STR_DEBUG 1 #define CCAN_STR_DEBUG 1
#include <ccan/str/str.h> #include <ccan/str/str.h>
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
#if !HAVE_TYPEOF #if !HAVE_TYPEOF
......
#define CCAN_STR_DEBUG 1 #define CCAN_STR_DEBUG 1
#include <ccan/str/str.h> #include <ccan/str/str.h>
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
#if !HAVE_TYPEOF #if !HAVE_TYPEOF
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <ccan/tap/tap.h> #include <ccan/tap/tap.h>
#include <stdint.h> #include <stdint.h>
int main(int argc, char *argv[]) int main(void)
{ {
char str[1000]; char str[1000];
struct { struct {
......
...@@ -21,7 +21,7 @@ static char *strdup_rev(const char *s) ...@@ -21,7 +21,7 @@ static char *strdup_rev(const char *s)
return ret; return ret;
} }
int main(int argc, char *argv[]) int main(void)
{ {
unsigned int i, j, n; unsigned int i, j, n;
char *strings[NUM_SUBSTRINGS * NUM_SUBSTRINGS]; char *strings[NUM_SUBSTRINGS * NUM_SUBSTRINGS];
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <ccan/tal/str/str.h> #include <ccan/tal/str/str.h>
int int
main(int argc, char *argv[]) main(void)
{ {
unsigned int i; unsigned int i;
char **split, *str; char **split, *str;
......
...@@ -9,7 +9,7 @@ static void destroy_obj(void *obj) ...@@ -9,7 +9,7 @@ static void destroy_obj(void *obj)
destroy_count++; destroy_count++;
} }
int main(int argc, char *argv[]) int main(void)
{ {
char *linkable, *p1, *p2, *p3; char *linkable, *p1, *p2, *p3;
void **voidpp; void **voidpp;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
* return retval; * return retval;
* } * }
* *
* int main(int argc, char *argv[]) * int main(void)
* { * {
* tal_t *tmp_ctx = tal_newframe(); * tal_t *tmp_ctx = tal_newframe();
* int *val = do_work(); * int *val = do_work();
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "helper.h" #include "helper.h"
/* Empty format string: should still terminate! */ /* Empty format string: should still terminate! */
int main(int argc, char *argv[]) int main(void)
{ {
char *str; char *str;
const char *fmt = ""; const char *fmt = "";
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <ccan/tap/tap.h> #include <ccan/tap/tap.h>
#include "helper.h" #include "helper.h"
int main(int argc, char *argv[]) int main(void)
{ {
char *str, *copy; char *str, *copy;
......
...@@ -14,7 +14,7 @@ static bool find_parent(tal_t *child, tal_t *parent) ...@@ -14,7 +14,7 @@ static bool find_parent(tal_t *child, tal_t *parent)
return false; return false;
} }
int main(int argc, char *argv[]) int main(void)
{ {
void *ctx = tal_strdup(NULL, "toplevel"); void *ctx = tal_strdup(NULL, "toplevel");
char *a, *b; char *a, *b;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
static const char *substrings[] static const char *substrings[]
= { "far", "bar", "baz", "b", "ba", "z", "ar", NULL }; = { "far", "bar", "baz", "b", "ba", "z", "ar", NULL };
int main(int argc, char *argv[]) int main(void)
{ {
char **split, *str; char **split, *str;
void *ctx; void *ctx;
......
...@@ -22,7 +22,7 @@ struct info_tcon { ...@@ -22,7 +22,7 @@ struct info_tcon {
TCON(TCON_CONTAINER(concan, struct outer, inner)); TCON(TCON_CONTAINER(concan, struct outer, inner));
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct info_tcon info; struct info_tcon info;
struct outer ovar; struct outer ovar;
......
...@@ -17,7 +17,7 @@ struct info_base { ...@@ -17,7 +17,7 @@ struct info_base {
char *infop; char *infop;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
TCON_WRAP(struct info_base, TCON_WRAP(struct info_base,
TCON_CONTAINER(concan, struct outer, inner)) info; TCON_CONTAINER(concan, struct outer, inner)) info;
......
...@@ -22,7 +22,7 @@ struct info_tcon { ...@@ -22,7 +22,7 @@ struct info_tcon {
TCON(TCON_CONTAINER(concan, struct outer, inner)); TCON(TCON_CONTAINER(concan, struct outer, inner));
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct info_tcon info; struct info_tcon info;
struct outer ovar; struct outer ovar;
......
...@@ -17,7 +17,7 @@ struct info_base { ...@@ -17,7 +17,7 @@ struct info_base {
char *infop; char *infop;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
TCON_WRAP(struct info_base, TCON_WRAP(struct info_base,
TCON_CONTAINER(concan, struct outer, inner)) info; TCON_CONTAINER(concan, struct outer, inner)) info;
......
...@@ -22,7 +22,7 @@ struct info_tcon { ...@@ -22,7 +22,7 @@ struct info_tcon {
TCON(TCON_CONTAINER(concan, struct outer, inner)); TCON(TCON_CONTAINER(concan, struct outer, inner));
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct info_tcon info; struct info_tcon info;
struct outer ovar; struct outer ovar;
......
...@@ -17,7 +17,7 @@ struct info_base { ...@@ -17,7 +17,7 @@ struct info_base {
char *infop; char *infop;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
TCON_WRAP(struct info_base, TCON_WRAP(struct info_base,
TCON_CONTAINER(concan, struct outer, inner)) info; TCON_CONTAINER(concan, struct outer, inner)) info;
......
...@@ -22,7 +22,7 @@ struct info_tcon { ...@@ -22,7 +22,7 @@ struct info_tcon {
TCON(TCON_CONTAINER(concan, struct outer, inner)); TCON(TCON_CONTAINER(concan, struct outer, inner));
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct info_tcon info; struct info_tcon info;
struct outer ovar; struct outer ovar;
......
...@@ -17,7 +17,7 @@ struct info_base { ...@@ -17,7 +17,7 @@ struct info_base {
char *infop; char *infop;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
TCON_WRAP(struct info_base, TCON_WRAP(struct info_base,
TCON_CONTAINER(concan, struct outer, inner)) info; TCON_CONTAINER(concan, struct outer, inner)) info;
......
...@@ -10,7 +10,7 @@ struct int_and_charp_container { ...@@ -10,7 +10,7 @@ struct int_and_charp_container {
TCON(int *tc1; char *tc2); TCON(int *tc1; char *tc2);
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct int_and_charp_container icon; struct int_and_charp_container icon;
#ifdef FAIL #ifdef FAIL
......
...@@ -5,7 +5,7 @@ struct container { ...@@ -5,7 +5,7 @@ struct container {
void *p; void *p;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
TCON_WRAP(struct container, TCON_WRAP(struct container,
int *tc1; char *tc2) icon; int *tc1; char *tc2) icon;
......
...@@ -5,7 +5,7 @@ struct container { ...@@ -5,7 +5,7 @@ struct container {
void *p; void *p;
}; };
int main(int argc, char *argv[]) int main(void)
{ {
TCON_WRAP(struct container, int *canary) icon; TCON_WRAP(struct container, int *canary) icon;
#ifdef FAIL #ifdef FAIL
......
...@@ -10,7 +10,7 @@ struct int_container { ...@@ -10,7 +10,7 @@ struct int_container {
TCON(int *canary); TCON(int *canary);
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct int_container icon; struct int_container icon;
#ifdef FAIL #ifdef FAIL
......
...@@ -22,7 +22,7 @@ struct info_tcon { ...@@ -22,7 +22,7 @@ struct info_tcon {
TCON(TCON_CONTAINER(fi, struct outer, inner)); TCON(TCON_CONTAINER(fi, struct outer, inner));
}; };
int main(int argc, char *argv[]) int main(void)
{ {
/* Const should work! */ /* Const should work! */
const struct outer *ovar = NULL; const struct outer *ovar = NULL;
......
...@@ -16,7 +16,7 @@ struct charp_and_int_container { ...@@ -16,7 +16,7 @@ struct charp_and_int_container {
TCON(int tc1; char *tc2); TCON(int tc1; char *tc2);
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct int_container icon; struct int_container icon;
struct charp_and_int_container cicon; struct charp_and_int_container cicon;
......
...@@ -26,7 +26,7 @@ struct offs_container { ...@@ -26,7 +26,7 @@ struct offs_container {
TCON_VALUE(off2, offsetof(struct other_struct, x2))); TCON_VALUE(off2, offsetof(struct other_struct, x2)));
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct val_container valcon; struct val_container valcon;
struct offs_container offscon; struct offs_container offscon;
......
...@@ -28,7 +28,7 @@ struct info_tcon { ...@@ -28,7 +28,7 @@ struct info_tcon {
TCON_CONTAINER(fi2, struct outer0, inner)); TCON_CONTAINER(fi2, struct outer0, inner));
}; };
int main(int argc, char *argv[]) int main(void)
{ {
struct info_tcon info; struct info_tcon info;
TCON_WRAP(struct info_base, TCON_WRAP(struct info_base,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
typedef TCON_WRAP(int, char *canary) canaried_int; typedef TCON_WRAP(int, char *canary) canaried_int;
int main(int argc, char *argv[]) int main(void)
{ {
canaried_int ci = TCON_WRAP_INIT(0); canaried_int ci = TCON_WRAP_INIT(0);
......
...@@ -23,7 +23,7 @@ static void update_and_expire(struct timers *timers) ...@@ -23,7 +23,7 @@ static void update_and_expire(struct timers *timers)
free(timers_expire(timers, when)); free(timers_expire(timers, when));
} }
int main(int argc, char *argv[]) int main(void)
{ {
struct timemono when; struct timemono when;
struct timers timers; struct timers timers;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <ccan/tap/tap.h> #include <ccan/tap/tap.h>
/* This is the original pre-cut-down dump. */ /* This is the original pre-cut-down dump. */
int main(int argc, char *argv[]) int main(void)
{ {
struct timemono when; struct timemono when;
struct timers timers; struct timers timers;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <ccan/tap/tap.h> #include <ccan/tap/tap.h>
/* This is the original pre-cut-down dump. */ /* This is the original pre-cut-down dump. */
int main(int argc, char *argv[]) int main(void)
{ {
struct timemono when; struct timemono when;
struct timers timers; struct timers timers;
......
...@@ -8,7 +8,7 @@ static void _set_some_value(void *val) ...@@ -8,7 +8,7 @@ static void _set_some_value(void *val)
#define set_some_value(expr) \ #define set_some_value(expr) \
_set_some_value(typesafe_cb_cast(void *, long, (expr))) _set_some_value(typesafe_cb_cast(void *, long, (expr)))
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
bool x = 0; bool x = 0;
......
...@@ -17,7 +17,7 @@ void my_callback(int something) ...@@ -17,7 +17,7 @@ void my_callback(int something)
{ {
} }
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
/* This fails due to arg, not due to cast. */ /* This fails due to arg, not due to cast. */
......
...@@ -12,7 +12,7 @@ static void my_callback(char *p) ...@@ -12,7 +12,7 @@ static void my_callback(char *p)
{ {
} }
int main(int argc, char *argv[]) int main(void)
{ {
char str[] = "hello world"; char str[] = "hello world";
#ifdef FAIL #ifdef FAIL
......
...@@ -25,7 +25,7 @@ static void take_any(struct any *any) ...@@ -25,7 +25,7 @@ static void take_any(struct any *any)
{ {
} }
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
struct other struct other
......
...@@ -9,7 +9,7 @@ void _set_some_value(void *val) ...@@ -9,7 +9,7 @@ void _set_some_value(void *val)
#define set_some_value(expr) \ #define set_some_value(expr) \
_set_some_value(typesafe_cb_cast(void *, unsigned long, (expr))) _set_some_value(typesafe_cb_cast(void *, unsigned long, (expr)))
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
int x = 0; int x = 0;
......
...@@ -11,7 +11,7 @@ static void my_callback(char *p, int x) ...@@ -11,7 +11,7 @@ static void my_callback(char *p, int x)
{ {
} }
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
int *p; int *p;
......
...@@ -12,7 +12,7 @@ static void my_callback(int x, char *p) ...@@ -12,7 +12,7 @@ static void my_callback(int x, char *p)
{ {
} }
int main(int argc, char *argv[]) int main(void)
{ {
#ifdef FAIL #ifdef FAIL
int *p; int *p;
......
...@@ -10,7 +10,7 @@ static void _register_callback(void (*cb)(const void *arg), const void *arg) ...@@ -10,7 +10,7 @@ static void _register_callback(void (*cb)(const void *arg), const void *arg)
#define register_callback(cb, arg) \ #define register_callback(cb, arg) \
_register_callback(typesafe_cb(void, const void *, (cb), (arg)), (arg)) _register_callback(typesafe_cb(void, const void *, (cb), (arg)), (arg))
int main(int argc, char *argv[]) int main(void)
{ {
register_callback(NULL, "hello world"); register_callback(NULL, "hello world");
return 0; return 0;
......
...@@ -38,7 +38,7 @@ static void my_callback_post(struct undefined *undef, int x) ...@@ -38,7 +38,7 @@ static void my_callback_post(struct undefined *undef, int x)
{ {
} }
int main(int argc, char *argv[]) int main(void)
{ {
struct undefined *handle = NULL; struct undefined *handle = NULL;
......
...@@ -38,7 +38,7 @@ static void my_callback_post(struct undefined *undef, int x) ...@@ -38,7 +38,7 @@ static void my_callback_post(struct undefined *undef, int x)
{ {
} }
int main(int argc, char *argv[]) int main(void)
{ {
struct undefined *handle = NULL; struct undefined *handle = NULL;
void (*cb)(struct undefined *undef) = my_callback; void (*cb)(struct undefined *undef) = my_callback;
......
...@@ -21,7 +21,7 @@ static void take_any(struct any *any) ...@@ -21,7 +21,7 @@ static void take_any(struct any *any)
{ {
} }
int main(int argc, char *argv[]) int main(void)
{ {
/* Otherwise we get unused warnings for these. */ /* Otherwise we get unused warnings for these. */
struct foo *foo = NULL; struct foo *foo = NULL;
......
...@@ -89,7 +89,7 @@ struct callback_postargs cb_postargs ...@@ -89,7 +89,7 @@ struct callback_postargs cb_postargs
= { typesafe_cb_postargs(void, void *, my_callback_postargs, = { typesafe_cb_postargs(void, void *, my_callback_postargs,
(char *)(intptr_t)"hi", int, int), "hi" }; (char *)(intptr_t)"hi", int, int), "hi" };
int main(int argc, char *argv[]) int main(void)
{ {
void *p = &dummy; void *p = &dummy;
unsigned long l = (unsigned long)p; unsigned long l = (unsigned long)p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment