[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: switch to C99 breaks DFA tests
From: |
Paul Eggert |
Subject: |
Re: switch to C99 breaks DFA tests |
Date: |
Tue, 10 Jan 2017 14:40:53 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 |
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.
0001-dfa-port-to-older-GCC.patch
Description: Source code patch