From bdef55a9aabc9f378d70e0c82dd797f879fca856 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 3 Nov 2022 11:05:58 +0100 Subject: [PATCH] Support building with -Werror=strict-prototypes / -Werror=old-style-definition Unfortunately "-std=c99" is not sufficient to make gcc ignore cold 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: I84fd99442d0cc400fa562fa33623c142649230e2 --- include/osmocom/core/counter.h | 2 +- include/osmocom/core/select.h | 6 +++--- include/osmocom/gprs/gprs_bssgp.h | 2 +- include/osmocom/gsm/gsm0808.h | 6 +++--- include/osmocom/vty/command.h | 4 ++-- include/osmocom/vty/logging.h | 2 +- src/counter.c | 2 +- src/gb/gprs_bssgp.c | 2 +- src/gsm/gsm0808.c | 6 +++--- src/select.c | 6 +++--- src/time_cc.c | 2 +- src/vty/cpu_sched_vty.c | 2 +- src/vty/logging_vty.c | 2 +- src/vty/stats_vty.c | 2 +- utils/osmo-aka-verify.c | 2 +- utils/osmo-auc-gen.c | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/osmocom/core/counter.h b/include/osmocom/core/counter.h index 0d56bc4a2..7b677cb14 100644 --- a/include/osmocom/core/counter.h +++ b/include/osmocom/core/counter.h @@ -52,7 +52,7 @@ void osmo_counter_free(struct osmo_counter *ctr) int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data); -int osmo_counters_count(); +int osmo_counters_count(void); struct osmo_counter *osmo_counter_get_by_name(const char *name); diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h index e9f19a562..fc1485121 100644 --- a/include/osmocom/core/select.h +++ b/include/osmocom/core/select.h @@ -105,8 +105,8 @@ struct osmo_signalfd { struct osmo_signalfd * osmo_signalfd_setup(void *ctx, sigset_t set, osmo_signalfd_cb *cb, void *data); -void osmo_select_shutdown_request(); -int osmo_select_shutdown_requested(); -bool osmo_select_shutdown_done(); +void osmo_select_shutdown_request(void); +int osmo_select_shutdown_requested(void); +bool osmo_select_shutdown_done(void); /*! @} */ diff --git a/include/osmocom/gprs/gprs_bssgp.h b/include/osmocom/gprs/gprs_bssgp.h index 09f640dc8..6c0433271 100644 --- a/include/osmocom/gprs/gprs_bssgp.h +++ b/include/osmocom/gprs/gprs_bssgp.h @@ -235,7 +235,7 @@ int bssgp_fc_in(struct bssgp_flow_control *fc, struct msgb *msg, int bssgp_fc_ms_init(struct bssgp_flow_control *fc_ms, uint16_t bvci, uint16_t nsei, uint32_t max_queue_depth); -void bssgp_flush_all_queues(); +void bssgp_flush_all_queues(void); void bssgp_fc_flush_queue(struct bssgp_flow_control *fc); /* gprs_bssgp_vty.c */ diff --git a/include/osmocom/gsm/gsm0808.h b/include/osmocom/gsm/gsm0808.h index b4c780328..dcff4159f 100644 --- a/include/osmocom/gsm/gsm0808.h +++ b/include/osmocom/gsm/gsm0808.h @@ -73,7 +73,7 @@ struct msgb *gsm0808_create_cipher2(const struct gsm0808_cipher_mode_command *cm struct msgb *gsm0808_create_cipher_complete(struct msgb *layer3, uint8_t alg_id); struct msgb *gsm0808_create_cipher_reject(enum gsm0808_cause cause); struct msgb *gsm0808_create_cipher_reject_ext(enum gsm0808_cause_class class, uint8_t ext); -struct msgb *gsm0808_create_classmark_request(); +struct msgb *gsm0808_create_classmark_request(void); struct msgb *gsm0808_create_classmark_update(const uint8_t *cm2, uint8_t cm2_len, const uint8_t *cm3, uint8_t cm3_len); struct msgb *gsm0808_create_sapi_reject_cause(uint8_t link_id, uint16_t cause); @@ -269,8 +269,8 @@ struct gsm0808_handover_command { }; struct msgb *gsm0808_create_handover_command(const struct gsm0808_handover_command *params); -struct msgb *gsm0808_create_handover_detect(); -struct msgb *gsm0808_create_handover_succeeded(); +struct msgb *gsm0808_create_handover_detect(void); +struct msgb *gsm0808_create_handover_succeeded(void); struct gsm0808_handover_complete { bool rr_cause_present; diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h index e3919fb8d..57fbe0e9c 100644 --- a/include/osmocom/vty/command.h +++ b/include/osmocom/vty/command.h @@ -442,8 +442,8 @@ char *argv_concat(const char **argv, int argc, int shift); vector cmd_make_strvec(const char *); int cmd_make_strvec2(const char *string, char **indent, vector *strvec_p); void cmd_free_strvec(vector); -vector cmd_describe_command(); -char **cmd_complete_command(); +vector cmd_describe_command(vector vline, struct vty * vty, int *status); +char **cmd_complete_command(vector vline, struct vty *vty, int *status); const char *cmd_prompt(enum node_type); int config_from_file(struct vty *, FILE *); enum node_type node_parent(enum node_type); diff --git a/include/osmocom/vty/logging.h b/include/osmocom/vty/logging.h index 90c8fa17b..0ea643216 100644 --- a/include/osmocom/vty/logging.h +++ b/include/osmocom/vty/logging.h @@ -6,7 +6,7 @@ #define FILTER_STR "Filter log messages\n" struct log_info; -void logging_vty_add_cmds(); +void logging_vty_add_cmds(void); void logging_vty_add_deprecated_subsys(void *ctx, const char *name); struct vty; struct log_target *osmo_log_vty2tgt(struct vty *vty); diff --git a/src/counter.c b/src/counter.c index cbee7b9e2..dace15f3a 100644 --- a/src/counter.c +++ b/src/counter.c @@ -75,7 +75,7 @@ int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), /*! Counts the registered counter * \returns amount of counters */ -int osmo_counters_count() +int osmo_counters_count(void) { return llist_count(&counters); } diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index c967f7305..7abef804b 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -1428,7 +1428,7 @@ void bssgp_fc_flush_queue(struct bssgp_flow_control *fc) /*! * \brief Flush the queues of all BSSGP contexts. */ -void bssgp_flush_all_queues() +void bssgp_flush_all_queues(void) { struct bssgp_bvc_ctx *bctx; diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index e05783277..89a8874d1 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -418,7 +418,7 @@ struct msgb *gsm0808_create_lcls_notification(enum gsm0808_lcls_status status, b /*! Create BSSMAP Classmark Request message * \returns callee-allocated msgb with BSSMAP Classmark Request message */ -struct msgb *gsm0808_create_classmark_request() +struct msgb *gsm0808_create_classmark_request(void) { struct msgb *msg = msgb_alloc_headroom(BSSMAP_MSG_SIZE, BSSMAP_MSG_HEADROOM, "classmark-request"); @@ -1110,7 +1110,7 @@ struct msgb *gsm0808_create_handover_command(const struct gsm0808_handover_comma /*! Create BSSMAP HANDOVER DETECT message, 3GPP TS 48.008 3.2.1.40. * Sent from the MT BSC back to the MSC when the MS has sent a handover RACH request and the MT BSC has * received the Handover Detect message. */ -struct msgb *gsm0808_create_handover_detect() +struct msgb *gsm0808_create_handover_detect(void) { struct msgb *msg; @@ -1129,7 +1129,7 @@ struct msgb *gsm0808_create_handover_detect() /*! Create BSSMAP HANDOVER SUCCEEDED message, 3GPP TS 48.008 3.2.1.13. * Sent from the MSC back to the old BSS to notify that the MS has successfully accessed the new BSS. */ -struct msgb *gsm0808_create_handover_succeeded() +struct msgb *gsm0808_create_handover_succeeded(void) { struct msgb *msg; diff --git a/src/select.c b/src/select.c index 735ea3eff..5aee7d8ca 100644 --- a/src/select.c +++ b/src/select.c @@ -653,20 +653,20 @@ osmo_signalfd_setup(void *ctx, sigset_t set, osmo_signalfd_cb *cb, void *data) * } * } */ -void osmo_select_shutdown_request() +void osmo_select_shutdown_request(void) { _osmo_select_shutdown_requested++; }; /*! Return the number of times osmo_select_shutdown_request() was called before. */ -int osmo_select_shutdown_requested() +int osmo_select_shutdown_requested(void) { return _osmo_select_shutdown_requested; }; /*! Return true after osmo_select_shutdown_requested() was called, and after an osmo_select poll loop found no more * pending OSMO_FD_WRITE on any registered socket. */ -bool osmo_select_shutdown_done() { +bool osmo_select_shutdown_done(void) { return _osmo_select_shutdown_done; }; diff --git a/src/time_cc.c b/src/time_cc.c index 05971fe8a..0e6879e5f 100644 --- a/src/time_cc.c +++ b/src/time_cc.c @@ -49,7 +49,7 @@ OSMO_MIN((TIME_CC)->cfg.round_threshold_usec, GRAN_USEC(TIME_CC)) \ : (GRAN_USEC(TIME_CC) / 2)) -static uint64_t time_now_usec() +static uint64_t time_now_usec(void) { struct timespec tp; if (osmo_clock_gettime(CLOCK_MONOTONIC, &tp)) diff --git a/src/vty/cpu_sched_vty.c b/src/vty/cpu_sched_vty.c index dbb3cd59a..301e7a69f 100644 --- a/src/vty/cpu_sched_vty.c +++ b/src/vty/cpu_sched_vty.c @@ -89,7 +89,7 @@ static struct cmd_node sched_node = { }; /* returns number of configured CPUs in the system, or negative otherwise */ -static int get_num_cpus() { +static int get_num_cpus(void) { static unsigned int num_cpus = 0; long ln; diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index c83dafdd8..59c8a9cd5 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -1196,7 +1196,7 @@ static void gen_vty_logp_cmd_strs(struct cmd_element *cmd) /*! Register logging related commands to the VTY. Call this once from * your application if you want to support those commands. */ -void logging_vty_add_cmds() +void logging_vty_add_cmds(void) { install_lib_element_ve(&enable_logging_cmd); install_lib_element_ve(&disable_logging_cmd); diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index e5acfa2c3..299ec244d 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -742,7 +742,7 @@ static int config_write_stats(struct vty *vty) * Call this once during your application initialization if you would * like to have stats VTY commands enabled. */ -void osmo_stats_vty_add_cmds() +void osmo_stats_vty_add_cmds(void) { install_lib_element_ve(&show_stats_cmd); install_lib_element_ve(&show_stats_level_cmd); diff --git a/utils/osmo-aka-verify.c b/utils/osmo-aka-verify.c index bbc65ef7f..f23c349b9 100644 --- a/utils/osmo-aka-verify.c +++ b/utils/osmo-aka-verify.c @@ -88,7 +88,7 @@ static int milenage_check(const uint8_t *opc, const uint8_t *k, const uint8_t *s } -static void help() +static void help(void) { printf( "Static SIM card parameters:\n" "-k --key\tSpecify Ki / K\n" diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index 72f1fcd4b..e3e1b431e 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -85,7 +85,7 @@ static struct osmo_sub_auth_data test_aud = { .algo = OSMO_AUTH_ALG_NONE, }; -static void help() +static void help(void) { int alg; printf( "-2 --2g\tUse 2G (GSM) authentication\n"