examples/l3fwd-power: fix build with gcc 4

Message ID 20190629085507.31808-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Headers
Series examples/l3fwd-power: fix build with gcc 4 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation fail apply issues

Commit Message

Thomas Monjalon June 29, 2019, 8:55 a.m. UTC
  error: ‘for’ loop initial declarations are only allowed in C99 mode

Fixes: 609e79841fcf ("examples/l3fwd-power: add telemetry mode")
Cc: reshma.pattan@intel.com

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 examples/l3fwd-power/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Thomas Monjalon June 29, 2019, 12:27 p.m. UTC | #1
29/06/2019 10:55, Thomas Monjalon:
> error: ‘for’ loop initial declarations are only allowed in C99 mode
> 
> Fixes: 609e79841fcf ("examples/l3fwd-power: add telemetry mode")
> Cc: reshma.pattan@intel.com
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Applied quickly in the hope of getting CI in a stable state.
  

Patch

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fb2a9d62f..99c1208ce 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -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);