From 03476e93605c5f9ef91e2bb58375bbae81c3cd09 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sun, 3 Oct 2021 23:03:14 +0000 Subject: [PATCH] yml: silence unused variable warning with Clang 13 yml.c:383:9: error: variable 'indent' set but not used [-Werror,-Wunused-but-set-variable] int indent = 0; ^ --- yml.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yml.c b/yml.c index 52370ef..6afa8d6 100644 --- a/yml.c +++ b/yml.c @@ -9,6 +9,8 @@ #include #include +#define UNUSED __attribute__((unused)) + enum yml_error { YML_ERR_NONE, YML_ERR_DUPLICATE_KEY, @@ -380,7 +382,7 @@ yml_load(FILE *yml, char **error) yaml_parser_set_input_file(&yaml, yml); bool done = false; - int indent = 0; + int indent UNUSED = 0; struct yml_node *root = malloc(sizeof(*root)); root->type = ROOT;