On 01/10/2017 01:27 PM, Assaf Gordon wrote: > dfa.c:727:3: error: ‘for’ loop initial declarations are only \ > allowed in C99 mode > for (int i = 0; i < CHARCLASS_WORDS; i++) > ^ > Yes, the DFA module uses C99 statement-after-declaration syntax. Awk was the last dfa-using package that tried to port to C89 compilers, and when Awk no longer required that we started using that C99 feature and don't really want to go back.
You ran into a problem because your old version of GCC defaults to C89ish syntax. We didn't run into the problem because we are either using newer GCC, or are using the dfa module in a package that tells GCC to be C99-or-later compatible. I installed the attached to try to work around the problem. Possibly we should instead just start assuming C99 everywhere? At least, the declaration-after-statement part.
From 20760bb7ef831bfe437c75d56a273fb2e8da0288 Mon Sep 17 00:00:00 2001 From: Paul Eggert <eggert@cs.ucla.edu> Date: Tue, 10 Jan 2017 14:35:34 -0800 Subject: [PATCH] dfa: port to older GCC Problem reported by Assaf Gordon in: http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00103.html * modules/c99: New module. This merely attempts to use the latest C version, which should be enough to solve this particular problem. The idea is to document which Gnulib modules assume C99 or later. * modules/dfa (Depends-on): Add it. --- ChangeLog | 10 ++++++++++ modules/c99 | 19 +++++++++++++++++++ modules/dfa | 1 + 3 files changed, 30 insertions(+) create mode 100644 modules/c99 diff --git a/ChangeLog b/ChangeLog index 9539f24..e74f075 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2017-01-10 Paul Eggert <eggert@cs.ucla.edu> + + dfa: port to older GCC + Problem reported by Assaf Gordon in: + http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00103.html + * modules/c99: New module. This merely attempts to use the latest + C version, which should be enough to solve this particular problem. + The idea is to document which Gnulib modules assume C99 or later. + * modules/dfa (Depends-on): Add it. + 2017-01-10 Bruno Haible <bruno@clisp.org> Update DEPENDENCIES. diff --git a/modules/c99 b/modules/c99 new file mode 100644 index 0000000..b6a9348 --- /dev/null +++ b/modules/c99 @@ -0,0 +1,19 @@ +Description: +Enable at least C99 if available. + +Files: + +Depends-on: +std-gnu11 + +configure.ac: + +Makefile.am: + +Include: + +License: +GPL + +Maintainer: +all diff --git a/modules/dfa b/modules/dfa index 581befd..504e7f0 100644 --- a/modules/dfa +++ b/modules/dfa @@ -9,6 +9,7 @@ lib/localeinfo.h Depends-on: assert +c99 ctype intprops isblank -- 2.9.3