examples/l3fwd-power: fix build with gcc 4
authorThomas Monjalon <thomas@monjalon.net>
Sat, 29 Jun 2019 08:45:50 +0000 (10:45 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 29 Jun 2019 12:29:49 +0000 (14:29 +0200)
error: ‘for’ loop initial declarations are only allowed in C99 mode

Fixes: 609e79841fcf ("examples/l3fwd-power: add telemetry mode")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
examples/l3fwd-power/main.c

index fb2a9d6..99c1208 100644 (file)
@@ -2468,10 +2468,12 @@ main(int argc, char **argv)
                rte_eal_mp_remote_launch(main_empty_poll_loop, NULL,
                                SKIP_MASTER);
        } else {
+               unsigned int i;
+
                /* Init metrics library */
                rte_metrics_init(rte_socket_id());
                /** Register stats with metrics library */
-               for (unsigned int i = 0; i < num_telstats; i++)
+               for (i = 0; i < num_telstats; i++)
                        ptr_strings[i] = telstats_strings[i].name;
 
                ret = rte_metrics_reg_names(ptr_strings, num_telstats);