Le 13 déc. 2012 à 18:48, Paul Eggert <[email protected]> a écrit :

> Coreutils's README says "you should have a C99-conforming
> compiler, due to the use of declarations after non-declaration
> statements in several files in src/" which is a bit of an
> exaggeration since it needs just C89 with a few C99 features,
> notably declarations after statements.

This is tempting.  Bison being a maintainer tool, I guess its
audience has typically better compilers than on average.  So
I expect it would not be a problem to have the same requirements.

I also see that there are also some uses of a declaration in the
for-loops, but surprisingly few:

akim@erebus ~/src/gnu/coreutils $ git grep -P 'for \(\w+ \w+'
ChangeLog-2005: (parse_options): Give a diagnostic for (but still accept) the
gl/lib/rand-isaac.c:  for (int i = 0; i < 4; i++)              /* scramble it */
gl/lib/rand-isaac.c:  for (int i = 0; i < 4; i++)              /* scramble it */
src/csplit.c:  for (size_t count = 0; ; count++)
src/ls.c:      for (int i = 0; i < 12; i++)
src/stat.c:                      for (char const *src = dst; src < p; src++)
src/stat.c:  for (int i = precision; i < 9; i++)

(And the first two seem to be #if 0'd).  Is it considered ok
too?


Reply via email to