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: I98a3c0d5cfda2c4b020652efb4f445f8288342b6
This commit is contained in:
Harald Welte 2022-11-03 11:41:05 +01:00
parent 5fb814b6b9
commit 9befdeb673
5 changed files with 9 additions and 9 deletions

View File

@ -227,7 +227,7 @@ static struct value_string osmo_mgcpc_ep_fsm_event_names[33] = {};
static char osmo_mgcpc_ep_fsm_event_name_bufs[32][32] = {};
static void fill_event_names()
static void fill_event_names(void)
{
int i;
for (i = 0; i < (ARRAY_SIZE(osmo_mgcpc_ep_fsm_event_names) - 1); i++) {
@ -243,7 +243,7 @@ static void fill_event_names()
}
}
static __attribute__((constructor)) void osmo_mgcpc_ep_fsm_init()
static __attribute__((constructor)) void osmo_mgcpc_ep_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&osmo_mgcpc_ep_fsm) == 0);
fill_event_names();

View File

@ -760,7 +760,7 @@ const char *osmo_mgcpc_conn_peer_name(const struct mgcp_conn_peer *info)
return buf;
}
static __attribute__((constructor)) void osmo_mgcp_client_fsm_init()
static __attribute__((constructor)) void osmo_mgcp_client_fsm_init(void)
{
OSMO_ASSERT(osmo_fsm_register(&fsm_mgcp_client) == 0);
}

View File

@ -95,7 +95,7 @@ static char *config_file = "osmo-mgw.cfg";
/* used by msgb and mgcp */
void *tall_mgw_ctx = NULL;
static void print_help()
static void print_help(void)
{
printf("Some useful options:\n");
printf(" -h --help is printing this text.\n");

View File

@ -2078,7 +2078,7 @@ static void test_mgcp_codec_pt_translate(void)
OSMO_ASSERT(ok);
}
void test_conn_id_matching()
void test_conn_id_matching(void)
{
struct mgcp_endpoint endp = {};
struct mgcp_conn *conn;
@ -2118,7 +2118,7 @@ void test_conn_id_matching()
talloc_free(conn);
}
void test_e1_trunk_nr_from_epname()
void test_e1_trunk_nr_from_epname(void)
{
unsigned int trunk_nr;
int rc;
@ -2168,7 +2168,7 @@ void test_e1_trunk_nr_from_epname()
return;
}
void test_mgcp_is_rtp_dummy_payload()
void test_mgcp_is_rtp_dummy_payload(void)
{
/* realistic rtp packet */
static const char rtp_payload[] =

View File

@ -315,7 +315,7 @@ void test_mgcp_msg(void)
msgb_free(msg);
}
void test_mgcp_client_cancel()
void test_mgcp_client_cancel(void)
{
mgcp_trans_id_t trans_id;
struct msgb *msg;
@ -487,7 +487,7 @@ static struct sdp_section_start_test sdp_section_start_tests[] = {
},
};
void test_sdp_section_start()
void test_sdp_section_start(void)
{
int i;
int failures = 0;