laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-pfcp/+/29979 )
Change subject: Support building with -Werror=strict-prototypes / -Werror=old-style-definition ......................................................................
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: I79c51b78d1b055361f9ef5434361847353791d0d --- M src/libosmo-gtlv/gtlv_gen.c M tests/libosmo-gtlv/gtlv_dec_enc_test.c M tests/libosmo-gtlv/gtlv_test.c M tests/libosmo-gtlv/test_gtlv_gen/gtlv_gen_test.c M tests/libosmo-gtlv/test_tliv/tliv_test.c M tests/libosmo-pfcp/pfcp_test.c 6 files changed, 15 insertions(+), 15 deletions(-)
Approvals: pespin: Looks good to me, approved fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified
diff --git a/src/libosmo-gtlv/gtlv_gen.c b/src/libosmo-gtlv/gtlv_gen.c index e374ea9..d3d407f 100644 --- a/src/libosmo-gtlv/gtlv_gen.c +++ b/src/libosmo-gtlv/gtlv_gen.c @@ -62,7 +62,7 @@ llist_add(&s->entry, &seen_list); return false; } -static void clear_seen() +static void clear_seen(void) { struct seen_entry *s; while ((s = llist_first_entry_or_null(&seen_list, struct seen_entry, entry))) { @@ -148,7 +148,7 @@
/* Write all auto-generated structs, starting with the outer message definitions and nesting into all contained IE * definitions. */ -static void write_auto_structs() +static void write_auto_structs(void) { const struct osmo_gtlv_gen_msg *gen_msg; clear_seen(); @@ -171,7 +171,7 @@ * myproto_msg_goo goo; * }; */ -static void write_msg_union() +static void write_msg_union(void) { const struct osmo_gtlv_gen_msg *gen_msg; for (gen_msg = g_cfg->msg_defs; gen_msg->name; gen_msg++) { @@ -193,7 +193,7 @@ }
/* Write the C header, myproto_ies_auto.h */ -static void write_h() +static void write_h(void) { printf("/* THIS FILE IS GENERATED FROM %s */\n", __FILE__); printf("#include <stdint.h>\n"); @@ -326,7 +326,7 @@ /* Write the bulk of the C code: on the basis of the list of messages (g_cfg->msg_defs), write all dec/enc function * declarations, all IEs arrays as well as the list of message types, first triggering to write the C code for any inner * layers. */ -static void write_c() +static void write_c(void) { const struct osmo_gtlv_gen_msg *gen_msg;
diff --git a/tests/libosmo-gtlv/gtlv_dec_enc_test.c b/tests/libosmo-gtlv/gtlv_dec_enc_test.c index 848c0ef..fe72a10 100644 --- a/tests/libosmo-gtlv/gtlv_dec_enc_test.c +++ b/tests/libosmo-gtlv/gtlv_dec_enc_test.c @@ -543,7 +543,7 @@ } }
-int main() +int main(int argc, char **argv) { ctx = talloc_named_const(NULL, 0, "gtlv_test"); msgb_talloc_ctx_init(ctx, 0); diff --git a/tests/libosmo-gtlv/gtlv_test.c b/tests/libosmo-gtlv/gtlv_test.c index 8023699..8711063 100644 --- a/tests/libosmo-gtlv/gtlv_test.c +++ b/tests/libosmo-gtlv/gtlv_test.c @@ -329,7 +329,7 @@ t8l8v_test_multi, };
-void test_t8l8v() +void test_t8l8v(void) { test_tlv(__func__, t8l8v_tests, ARRAY_SIZE(t8l8v_tests), &osmo_t8l8v_cfg); } @@ -378,7 +378,7 @@ t16l16v_test_multi, };
-void test_t16l16v() +void test_t16l16v(void) { test_tlv(__func__, t16l16v_tests, ARRAY_SIZE(t16l16v_tests), &osmo_t16l16v_cfg); } @@ -521,7 +521,7 @@ .store_tl = txlxv_store_tl, };
-void test_txlxv() +void test_txlxv(void) { test_tlv(__func__, txlxv_tests, ARRAY_SIZE(txlxv_tests), &txlxv_cfg); } @@ -609,12 +609,12 @@ tliv_test1, };
-void test_tliv() +void test_tliv(void) { test_tlv(__func__, tliv_tests, ARRAY_SIZE(tliv_tests), &osmo_tliv_cfg); }
-int main() +int main(int argc, char **argv) { ctx = talloc_named_const(NULL, 0, "gtlv_test"); msgb_talloc_ctx_init(ctx, 0); diff --git a/tests/libosmo-gtlv/test_gtlv_gen/gtlv_gen_test.c b/tests/libosmo-gtlv/test_gtlv_gen/gtlv_gen_test.c index 1997fdc..411b802 100644 --- a/tests/libosmo-gtlv/test_gtlv_gen/gtlv_gen_test.c +++ b/tests/libosmo-gtlv/test_gtlv_gen/gtlv_gen_test.c @@ -245,7 +245,7 @@ } }
-int main() +int main(int argc, char **argv) { ctx = talloc_named_const(NULL, 0, "test_gen_tlv"); msgb_talloc_ctx_init(ctx, 0); diff --git a/tests/libosmo-gtlv/test_tliv/tliv_test.c b/tests/libosmo-gtlv/test_tliv/tliv_test.c index 49ae25c..242fb1a 100644 --- a/tests/libosmo-gtlv/test_tliv/tliv_test.c +++ b/tests/libosmo-gtlv/test_tliv/tliv_test.c @@ -204,7 +204,7 @@ .store_tl = tliv_store_tl, };
-int main() +int main(int argc, char **argv) { ctx = talloc_named_const(NULL, 0, "test_gen_tlv"); msgb_talloc_ctx_init(ctx, 0); diff --git a/tests/libosmo-pfcp/pfcp_test.c b/tests/libosmo-pfcp/pfcp_test.c index 189622e..b0f3a50 100644 --- a/tests/libosmo-pfcp/pfcp_test.c +++ b/tests/libosmo-pfcp/pfcp_test.c @@ -451,7 +451,7 @@ }, };
-void test_enc_dec() +void test_enc_dec(void) { int i; for (i = 0; i < ARRAY_SIZE(tests); i++) { @@ -500,7 +500,7 @@ } }
-int main() +int main(int argc, char **argv) { ctx = talloc_named_const(NULL, 0, "pfcp_test"); msgb_talloc_ctx_init(ctx, 0);