]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: servers: Fix build with -std=gnu89
authorOlivier Houchard <cognet@ci0.org>
Wed, 10 Jun 2026 08:23:18 +0000 (10:23 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 10 Jun 2026 08:28:52 +0000 (10:28 +0200)
Commit 3c923d075 introduced a C99ism by declaring a variable in a for loop,
don't do that, especially since there already is a variable named "i"
declared.
This should fix the build when -std=c89 is used.
This should be backported if commit 3c923d075 is backported.

src/cfgparse.c

index 5e54500e640752a74af013b90c80d814d55f8a36..d1cb5af6f63ee7e2e1739ad98992fece8ea08f10 100644 (file)
@@ -2486,7 +2486,7 @@ init_proxies_list_stage1:
        /* At this point, target names have already been resolved. */
        /***********************************************************/
 
-       for (int i = 0; i < global.nbthread; i++) {
+       for (i = 0; i < global.nbthread; i++) {
                idle_conn_srv[i] = EB_ROOT;
                idle_conn_task[i] = task_new_on(i);
                if (!idle_conn_task[i]) {