aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-11-03 11:38:41 +0100
committerHarald Welte <laforge@osmocom.org>2022-11-03 12:56:24 +0100
commit7a4765325d1f6accdbad3b74abddc2760f014c11 (patch)
treef638191d039d92fe773e503e26a12a1629888fb1
parent53f6067e97ca77769dd94a6946d3bffdc2b118e7 (diff)
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
-rw-r--r--src/ctrl.c2
-rw-r--r--src/dgsm.c2
-rw-r--r--src/hlr.c4
-rw-r--r--src/hlr_db_tool.c2
-rw-r--r--src/lu_fsm.c2
-rw-r--r--src/mslookup/osmo-mslookup-client.c4
-rw-r--r--src/mslookup_server.c2
-rw-r--r--src/mslookup_server_mdns.c2
-rw-r--r--tests/auc/auc_test.c2
-rw-r--r--tests/auc/gen_ts_55_205_test_sets/main_template.c2
-rw-r--r--tests/db/db_test.c10
-rw-r--r--tests/mslookup/mdns_test.c6
-rw-r--r--tests/mslookup/mslookup_client_mdns_test.c18
-rw-r--r--tests/mslookup/mslookup_client_test.c4
-rw-r--r--tests/mslookup/mslookup_test.c4
15 files changed, 33 insertions, 33 deletions
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 @@ static int hlr_ctrl_node_lookup(void *data, vector vline, int *node_type,
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 @@ void dgsm_start(void *ctx)
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 @@ static int read_cb(struct osmo_gsup_conn *conn, struct msgb *msg)
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 @@ static struct {
.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 @@ static struct osmo_fsm lu_fsm = {
.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 @@ static void print_version(void)
"\n");
}
-static void print_help()
+static void print_help(void)
{
print_version();
printf(
@@ -555,7 +555,7 @@ int socket_init(const char *sock_path)
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 @@ static void set_result(struct osmo_mslookup_result *result,
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 @@ void osmo_mslookup_server_mdns_stop(struct osmo_mslookup_server_mdns *server)
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 @@ static void test_gen_vectors_3g_xor(void)
}
/* 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 @@ int rand_get(uint8_t *rand, unsigned int len)
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 @@ static int db_subscr_lu_str(struct db_context *dbc, int64_t subscr_id,
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 @@ static const struct sub_auth_data_str *mk_aud_3g(enum osmo_auth_algo algo,
return &aud;
}
-static void test_subscr_aud()
+static void test_subscr_aud(void)
{
int64_t id;
@@ -783,7 +783,7 @@ static void test_subscr_aud()
/* 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 @@ static void test_subscr_aud_invalid_len()
comment_end();
}
-static void test_subscr_sqn()
+static void test_subscr_sqn(void)
{
int64_t id;
@@ -918,7 +918,7 @@ static void test_subscr_sqn()
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 @@ static const struct osmo_mdns_rfc_header header_enc_dec_test_data[] = {
},
};
-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()
}
}
-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 @@ static void test_result_from_answer(void *ctx)
}
}
-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 @@ static int server_recv(struct osmo_fd *osmo_fd, unsigned int what)
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 @@ static void server_stop()
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 @@ static void client_recv(struct osmo_mslookup_client *client, uint32_t request_ha
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 @@ static void client_query()
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 @@ const struct timeval fake_time_start_time = { 0, 0 };
osmo_timers_update(); \
} while (0)
-static void fake_time_start()
+static void fake_time_start(void)
{
struct timespec *clock_override;
@@ -167,7 +167,7 @@ static void fake_time_start()
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 @@ static void test_server_client()
client_stop();
}
-bool is_multicast_enabled()
+bool is_multicast_enabled(void)
{
bool ret = true;
struct addrinfo *ai;
@@ -222,7 +222,7 @@ bool is_multicast_enabled()
/*
* 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 @@ const struct timeval fake_time_start_time = { 0, 0 };
osmo_timers_update(); \
} while (0)
-static void fake_time_start()
+static void fake_time_start(void)
{
struct timespec *clock_override;
@@ -169,7 +169,7 @@ static void result_cb_once(struct osmo_mslookup_client *client,
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 @@ const char *domains[] = {
"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 @@ void test_osmo_mslookup_query_init_from_domain_str()
}
}
-int main()
+int main(int argc, char **argv)
{
ctx = talloc_named_const(NULL, 0, "main");
osmo_init_logging2(ctx, NULL);