diff options
| author | Harald Welte <laforge@gnumonks.org> | 2018-09-25 22:51:20 +0200 | 
|---|---|---|
| committer | Harald Welte <laforge@gnumonks.org> | 2018-09-25 22:52:22 +0200 | 
| commit | eda6fe42a5ad33d27e305c1a9b1304ac1f1cc247 (patch) | |
| tree | 403195b3c96286912b16ecfbf4fb1d8f573568a2 | |
| parent | 0d67f483e2d240089105a4d241cb8c9085e245af (diff) | |
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
| -rw-r--r-- | utils/osmo-config-merge.c | 6 | 
1 files 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);  		}  | 
