Change in libosmocore[master]: osmo-config-merge: Don't use C99 'for' loop initial declarations

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Sep 25 20:52:34 UTC 2018


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/11095


Change subject: osmo-config-merge: Don't use C99 'for' loop initial declarations
......................................................................

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
---
M utils/osmo-config-merge.c
1 file changed, 4 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/95/11095/1

diff --git a/utils/osmo-config-merge.c b/utils/osmo-config-merge.c
index 131486c..3762c67 100644
--- a/utils/osmo-config-merge.c
+++ b/utils/osmo-config-merge.c
@@ -145,7 +145,8 @@
 			/* 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 @@
 
 	if (root->line) {
 		if (print_node_depth) {
-			for (int i = 0; i < level; i++)
+			int i;
+			for (i = 0; i < level; i++)
 				fputc('*', out);
 		}
 

-- 
To view, visit https://gerrit.osmocom.org/11095
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia29e85b648c1a427be88242306634efe890e250d
Gerrit-Change-Number: 11095
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180925/336add3a/attachment.htm>


More information about the gerrit-log mailing list