* [PATCH nftables] src/main.c: fix build with gcc <= 4.8
@ 2020-06-07 21:36 Fabrice Fontaine
2020-06-08 10:02 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2020-06-07 21:36 UTC (permalink / raw)
To: netfilter-devel; +Cc: Fabrice Fontaine
Since commit 719e44277f8e89323a87219b4d4bc7abac05b051, build with
gcc <= 4.8 fails on:
main.c:186:2: error: 'for' loop initial declarations are only allowed in C99 mode
for (size_t i = IDX_INTERACTIVE + 1; i < NR_NFT_OPTIONS; ++i)
^
Fixes:
- http://autobuild.buildroot.org/results/cf2359b8311fe91f9335c91f2bb4a730c9f4c9dc
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
src/main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/main.c b/src/main.c
index d830c7a2..e248a347 100644
--- a/src/main.c
+++ b/src/main.c
@@ -169,6 +169,7 @@ static void print_option(const struct nft_opt *opt)
static void show_help(const char *name)
{
+ size_t i;
printf("Usage: %s [ options ] [ cmds... ]\n"
"\n"
"Options:\n", name);
@@ -185,7 +186,7 @@ static void show_help(const char *name)
fputs("\n", stdout);
- for (size_t i = IDX_INTERACTIVE + 1; i < NR_NFT_OPTIONS; ++i)
+ for (i = IDX_INTERACTIVE + 1; i < NR_NFT_OPTIONS; ++i)
print_option(&nft_options[i]);
fputs("\n", stdout);
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH nftables] src/main.c: fix build with gcc <= 4.8
2020-06-07 21:36 [PATCH nftables] src/main.c: fix build with gcc <= 4.8 Fabrice Fontaine
@ 2020-06-08 10:02 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2020-06-08 10:02 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: netfilter-devel
On Sun, Jun 07, 2020 at 11:36:47PM +0200, Fabrice Fontaine wrote:
> Since commit 719e44277f8e89323a87219b4d4bc7abac05b051, build with
> gcc <= 4.8 fails on:
>
> main.c:186:2: error: 'for' loop initial declarations are only allowed in C99 mode
> for (size_t i = IDX_INTERACTIVE + 1; i < NR_NFT_OPTIONS; ++i)
> ^
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-08 10:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-07 21:36 [PATCH nftables] src/main.c: fix build with gcc <= 4.8 Fabrice Fontaine
2020-06-08 10:02 ` Pablo Neira Ayuso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.