From 5ad11ebb76656fac53f337007496cedb5398a411 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Thu, 29 Apr 2021 18:13:38 +0200 Subject: [PATCH] Added warnings (should be ok up to GCC 8) --- CMakeLists.txt | 3 +++ src/utils/toml.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eeacd970b..b28f7e898 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,6 +149,9 @@ target_compile_options(c3c PRIVATE -Wno-unknown-warning-option -Wignored-qualifiers -Wimplicit-fallthrough=3 -Wmisleading-indentation -Wold-style-declaration -Woverride-init -Wtype-limits -Wshift-negative-value + -Wnested-externs -Wvla + -Wpointer-arith -Wpacked -Wredundant-decls + -Walloc-zero -Wduplicated-cond -Wshadow -Wmissing-field-initializers -Wmissing-parameter-type -Wno-unused-result -Wno-maybe-uninitialized -Wno-unknown-pragmas -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter) diff --git a/src/utils/toml.c b/src/utils/toml.c index 7cb17fb76..deaa7d661 100644 --- a/src/utils/toml.c +++ b/src/utils/toml.c @@ -2018,13 +2018,13 @@ TomlTable *toml_walk_table_path(TomlParser *parser, TomlTable *table, goto error; } - TomlValue *new_table = toml_value_new_table(&err); + TomlValue *temp_table = toml_value_new_table(&err); if (err.code != TOML_OK) goto error; - toml_array_append(t->value.array, new_table, &err); + toml_array_append(t->value.array, temp_table, &err); if (err.code != TOML_OK) goto error; - real_table = new_table->value.table; + real_table = temp_table->value.table; } } else