Support building with -Werror=strict-prototypes / -Werror=old-style-definition

Unfortunately "-std=c99" is not sufficient to make gcc ignore code that
uses constructs of earlier C standards, which were abandoned in C99.

See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for
some related discussion.

Change-Id: I861be39275b40c522c02f553074c5a4489e87127
diff --git a/src/ctrl.c b/src/ctrl.c
index f101d25..11b0f5c 100644
--- a/src/ctrl.c
+++ b/src/ctrl.c
@@ -749,7 +749,7 @@
 	return 1;
 }
 
-static int hlr_ctrl_cmds_install()
+static int hlr_ctrl_cmds_install(void)
 {
 	int rc = 0;
 
diff --git a/src/dgsm.c b/src/dgsm.c
index bfa5df8..cdd82a2 100644
--- a/src/dgsm.c
+++ b/src/dgsm.c
@@ -191,7 +191,7 @@
 	dgsm_mdns_client_config_apply();
 }
 
-void dgsm_stop()
+void dgsm_stop(void)
 {
 	g_hlr->mslookup.allow_startup = false;
 	mslookup_server_mdns_config_apply();
diff --git a/src/hlr.c b/src/hlr.c
index 294da23..193dd38 100644
--- a/src/hlr.c
+++ b/src/hlr.c
@@ -568,12 +568,12 @@
 	return 0;
 }
 
-static void print_usage()
+static void print_usage(void)
 {
 	printf("Usage: osmo-hlr\n");
 }
 
-static void print_help()
+static void print_help(void)
 {
 	printf("  -h --help                  This text.\n");
 	printf("  -c --config-file filename  The config file to use.\n");
diff --git a/src/hlr_db_tool.c b/src/hlr_db_tool.c
index b2a26dc..058a12c 100644
--- a/src/hlr_db_tool.c
+++ b/src/hlr_db_tool.c
@@ -51,7 +51,7 @@
 	.db_upgrade = false,
 };
 
-static void print_help()
+static void print_help(void)
 {
 	printf("\n");
 	printf("Usage: osmo-hlr-db-tool [-l <hlr.db>] [create|import-nitb-db <nitb.db>]\n");
diff --git a/src/lu_fsm.c b/src/lu_fsm.c
index b5493db..8f02f5a 100644
--- a/src/lu_fsm.c
+++ b/src/lu_fsm.c
@@ -314,7 +314,7 @@
 	.cleanup = lu_fsm_cleanup,
 };
 
-static __attribute__((constructor)) void lu_fsm_init()
+static __attribute__((constructor)) void lu_fsm_init(void)
 {
 	OSMO_ASSERT(osmo_fsm_register(&lu_fsm) == 0);
 }
diff --git a/src/mslookup/osmo-mslookup-client.c b/src/mslookup/osmo-mslookup-client.c
index dff7d31..d2a629f 100644
--- a/src/mslookup/osmo-mslookup-client.c
+++ b/src/mslookup/osmo-mslookup-client.c
@@ -53,7 +53,7 @@
 	"\n");
 }
 
-static void print_help()
+static void print_help(void)
 {
 	print_version();
 	printf(
@@ -555,7 +555,7 @@
 	return 0;
 }
 
-void socket_close()
+void socket_close(void)
 {
 	struct socket_client *c, *n;
 	llist_for_each_entry_safe(c, n, &globals.socket_clients, entry)
diff --git a/src/mslookup_server.c b/src/mslookup_server.c
index 885adf8..3771369 100644
--- a/src/mslookup_server.c
+++ b/src/mslookup_server.c
@@ -49,7 +49,7 @@
 	result->age = age;
 }
 
-const struct mslookup_service_host *mslookup_server_get_local_gsup_addr()
+const struct mslookup_service_host *mslookup_server_get_local_gsup_addr(void)
 {
 	static struct mslookup_service_host gsup_bind = {};
 	struct mslookup_service_host *host;
diff --git a/src/mslookup_server_mdns.c b/src/mslookup_server_mdns.c
index a669526..3c7606a 100644
--- a/src/mslookup_server_mdns.c
+++ b/src/mslookup_server_mdns.c
@@ -121,7 +121,7 @@
 	talloc_free(server);
 }
 
-void mslookup_server_mdns_config_apply()
+void mslookup_server_mdns_config_apply(void)
 {
 	/* Check whether to start/stop/restart mDNS server */
 	bool should_run;
diff --git a/tests/auc/auc_test.c b/tests/auc/auc_test.c
index 6bf2eb2..61cf82f 100644
--- a/tests/auc/auc_test.c
+++ b/tests/auc/auc_test.c
@@ -509,7 +509,7 @@
 }
 
 /* Test a variety of invalid authentication data combinations */
-void test_gen_vectors_bad_args()
+void test_gen_vectors_bad_args(void)
 {
 	struct osmo_auth_vector vec;
 	uint8_t auts[14];
diff --git a/tests/auc/gen_ts_55_205_test_sets/main_template.c b/tests/auc/gen_ts_55_205_test_sets/main_template.c
index 509416a..ffdfa78 100644
--- a/tests/auc/gen_ts_55_205_test_sets/main_template.c
+++ b/tests/auc/gen_ts_55_205_test_sets/main_template.c
@@ -100,7 +100,7 @@
 
 FUNCTIONS
 
-int main()
+int main(int argc, char **argv)
 {
 	printf("3GPP TS 55.205 Test Sets\n");
 	void *tall_ctx = talloc_named_const(NULL, 1, "test");
diff --git a/tests/db/db_test.c b/tests/db/db_test.c
index 246b7db..ab997bf 100644
--- a/tests/db/db_test.c
+++ b/tests/db/db_test.c
@@ -246,7 +246,7 @@
 	return db_subscr_lu(dbc, subscr_id, &vlr_nr, is_ps, NULL);
 }
 
-static void test_subscr_create_update_sel_delete()
+static void test_subscr_create_update_sel_delete(void)
 {
 	int64_t id0, id1, id2, id_short;
 	comment_start();
@@ -541,7 +541,7 @@
 	return &aud;
 }
 
-static void test_subscr_aud()
+static void test_subscr_aud(void)
 {
 	int64_t id;
 
@@ -783,7 +783,7 @@
 
 /* Make each key too short in this test. Note that we can't set them longer than the allowed size without changing the
  * table structure. */
-static void test_subscr_aud_invalid_len()
+static void test_subscr_aud_invalid_len(void)
 {
 	int64_t id;
 
@@ -845,7 +845,7 @@
 	comment_end();
 }
 
-static void test_subscr_sqn()
+static void test_subscr_sqn(void)
 {
 	int64_t id;
 
@@ -918,7 +918,7 @@
 	comment_end();
 }
 
-static void test_ind()
+static void test_ind(void)
 {
 	comment_start();
 
diff --git a/tests/mslookup/mdns_test.c b/tests/mslookup/mdns_test.c
index 0c8be46..7b26f0f 100644
--- a/tests/mslookup/mdns_test.c
+++ b/tests/mslookup/mdns_test.c
@@ -216,7 +216,7 @@
 	},
 };
 
-void test_enc_dec_rfc_header()
+void test_enc_dec_rfc_header(void)
 {
 	int i;
 
@@ -241,7 +241,7 @@
 	}
 }
 
-void test_enc_dec_rfc_header_einval()
+void test_enc_dec_rfc_header_einval(void)
 {
 	struct osmo_mdns_rfc_header out = {0};
 	struct msgb *msg = msgb_alloc(4096, "dns_test");
@@ -578,7 +578,7 @@
 	}
 }
 
-int main()
+int main(int argc, char **argv)
 {
 	void *ctx = talloc_named_const(NULL, 0, "main");
 	osmo_init_logging2(ctx, NULL);
diff --git a/tests/mslookup/mslookup_client_mdns_test.c b/tests/mslookup/mslookup_client_mdns_test.c
index dc9d1d5..274e1e7 100644
--- a/tests/mslookup/mslookup_client_mdns_test.c
+++ b/tests/mslookup/mslookup_client_mdns_test.c
@@ -80,14 +80,14 @@
 	return n;
 }
 
-static void server_init()
+static void server_init(void)
 {
 	fprintf(stderr, "%s\n", __func__);
 	server_mc = osmo_mdns_sock_init(ctx, TEST_IP, TEST_PORT, server_recv, NULL, 0);
 	OSMO_ASSERT(server_mc);
 }
 
-static void server_stop()
+static void server_stop(void)
 {
 	fprintf(stderr, "%s\n", __func__);
 	OSMO_ASSERT(server_mc);
@@ -98,7 +98,7 @@
 struct osmo_mslookup_client* client;
 struct osmo_mslookup_client_method* client_method;
 
-static void client_init()
+static void client_init(void)
 {
 	fprintf(stderr, "%s\n", __func__);
 	client = osmo_mslookup_client_new(ctx);
@@ -117,7 +117,7 @@
 	osmo_mslookup_client_request_cancel(client, request_handle);
 }
 
-static void client_query()
+static void client_query(void)
 {
 	struct osmo_mslookup_id id = {.type = OSMO_MSLOOKUP_ID_IMSI,
 				      .imsi = "123456789012345"};
@@ -134,7 +134,7 @@
 	osmo_mslookup_client_request(client, &query, &handling);
 }
 
-static void client_stop()
+static void client_stop(void)
 {
 	fprintf(stderr, "%s\n", __func__);
 	osmo_mslookup_client_free(client);
@@ -154,7 +154,7 @@
 	osmo_timers_update(); \
 } while (0)
 
-static void fake_time_start()
+static void fake_time_start(void)
 {
 	struct timespec *clock_override;
 
@@ -167,7 +167,7 @@
 	osmo_clock_override_enable(CLOCK_MONOTONIC, true);
 	fake_time_passes(0, 0);
 }
-static void test_server_client()
+static void test_server_client(void)
 {
 	fprintf(stderr, "-- %s --\n", __func__);
 	server_init();
@@ -190,7 +190,7 @@
 	client_stop();
 }
 
-bool is_multicast_enabled()
+bool is_multicast_enabled(void)
 {
 	bool ret = true;
 	struct addrinfo *ai;
@@ -222,7 +222,7 @@
 /*
  * Run all tests
  */
-int main()
+int main(int argc, char **argv)
 {
 	if (!is_multicast_enabled()) {
 		fprintf(stderr, "ERROR: multicast is disabled! (OS#4361)");
diff --git a/tests/mslookup/mslookup_client_test.c b/tests/mslookup/mslookup_client_test.c
index 9fcb983..84b7810 100644
--- a/tests/mslookup/mslookup_client_test.c
+++ b/tests/mslookup/mslookup_client_test.c
@@ -147,7 +147,7 @@
 	osmo_timers_update(); \
 } while (0)
 
-static void fake_time_start()
+static void fake_time_start(void)
 {
 	struct timespec *clock_override;
 
@@ -169,7 +169,7 @@
 	LOGP(DMSLOOKUP, LOGL_DEBUG, "result_cb(): %s\n", osmo_mslookup_result_name_c(ctx, query, result));
 }
 
-int main()
+int main(int argc, char **argv)
 {
 	ctx = talloc_named_const(NULL, 0, "main");
 	osmo_init_logging2(ctx, NULL);
diff --git a/tests/mslookup/mslookup_test.c b/tests/mslookup/mslookup_test.c
index a5efa00..742e14b 100644
--- a/tests/mslookup/mslookup_test.c
+++ b/tests/mslookup/mslookup_test.c
@@ -50,7 +50,7 @@
 	"qwerty.1.qwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmqwertyuiopasdfghjklzxcvbnmm",
 };
 
-void test_osmo_mslookup_query_init_from_domain_str()
+void test_osmo_mslookup_query_init_from_domain_str(void)
 {
 	int i;
 	for (i = 0; i < ARRAY_SIZE(domains); i++) {
@@ -68,7 +68,7 @@
 	}
 }
 
-int main()
+int main(int argc, char **argv)
 {
 	ctx = talloc_named_const(NULL, 0, "main");
 	osmo_init_logging2(ctx, NULL);