From eda6fe42a5ad33d27e305c1a9b1304ac1f1cc247 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 25 Sep 2018 22:51:20 +0200 Subject: osmo-config-merge: Don't use C99 'for' loop initial declarations The existing code passed gerrit build verification but failed the master builds with the following error: osmo-config-merge.c:148:4: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < cur_indent - indent; i++) { ^ osmo-config-merge.c:148:4: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code Change-Id: Ia29e85b648c1a427be88242306634efe890e250d --- utils/osmo-config-merge.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/osmo-config-merge.c b/utils/osmo-config-merge.c index 131486c1..3762c679 100644 --- a/utils/osmo-config-merge.c +++ b/utils/osmo-config-merge.c @@ -145,7 +145,8 @@ static struct node *file_read(void *ctx, const char *fname) /* new child to last node */ n = node_alloc_child(last); } else if (indent < cur_indent) { - for (int i = 0; i < cur_indent - indent; i++) { + int i; + for (i = 0; i < cur_indent - indent; i++) { /* go to parent, add another sibling */ if (last->parent) last = last->parent; @@ -202,7 +203,8 @@ static void dump_node(struct node *root, FILE *out, bool print_node_depth) if (root->line) { if (print_node_depth) { - for (int i = 0; i < level; i++) + int i; + for (i = 0; i < level; i++) fputc('*', out); } -- cgit v1.2.3