Fix compilation error
loop initial declarations are only allowed in C99 or C11 mode.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Signed-off-by: Lijianhui <airbak.li@hisilicon.com>
diff --git a/benchmark_aux.c b/benchmark_aux.c
index 90e8e62..7995c18 100644
--- a/benchmark_aux.c
+++ b/benchmark_aux.c
@@ -77,6 +77,7 @@
char *res, *base;
char path[PATH_MAX];
char **testapp_argv;
+ int i;
res = realpath(argv[1], path);
if (!res)
@@ -96,7 +97,7 @@
memcpy(testapp_argv[0], base, strlen(base) + 1);
- for (int i = 2; i < argc; i++) {
+ for (i = 2; i < argc; i++) {
size_t length = strlen(argv[i]) + 1;
testapp_argv[i - 1] = malloc(length);
@@ -109,7 +110,8 @@
void dealloc_argv(int new_argc, char **new_argv)
{
- for (int i = 0; i < new_argc; ++i)
+ int i;
+ for (i = 0; i < new_argc; ++i)
free(new_argv[i]);
free(new_argv);