From 0b76011a45b421b1473e9be75e538d3ceadf1140 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 21 Mar 2025 15:37:51 -0400 Subject: Remove some less-supported code features like static initializers for variable-sized arrays --- stdlib/stdlib.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'stdlib/stdlib.c') diff --git a/stdlib/stdlib.c b/stdlib/stdlib.c index 9b117a24..9103e4dd 100644 --- a/stdlib/stdlib.c +++ b/stdlib/stdlib.c @@ -224,8 +224,10 @@ static Table_t parse_table(const TypeInfo_t *table, int n, char *args[]) #pragma GCC diagnostic ignored "-Wstack-protector" public void _tomo_parse_args(int argc, char *argv[], Text_t usage, Text_t help, int spec_len, cli_arg_t spec[spec_len]) { - bool populated_args[spec_len] = {}; - bool used_args[argc] = {}; + bool populated_args[spec_len]; + bool used_args[argc]; + memset(populated_args, 0, sizeof(populated_args)); + memset(used_args, 0, sizeof(used_args)); for (int i = 1; i < argc; ) { if (argv[i][0] == '-' && argv[i][1] == '-') { if (argv[i][2] == '\0') { // "--" signals the rest of the arguments are literal -- cgit v1.2.3