Re: [LTP] [PATCH 2/3] fanotify10: Add support for multiple event files

Petr Vorel
2022-11-17T15:59:13Z

Hi Jan, all,

> +#define foreach_path(tc, buf, pname) \
> + for (int piter = 0; format_path_check((buf), (tc)->pname##_fmt, \
Unfortunately we still support C99 due old compiler on CentOS 7,
therefore int piter needs to be defined outside of for loop.

fanotify10.c:470:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int piter = 0; format_path_check((buf), (tc)->pname##_fmt, \
^

fanotify10.c:470:11: error: redefinition of ‘piter’
for (int piter = 0; format_path_check((buf), (tc)->pname##_fmt, \
^
Kind regards,
Petr