Hi Paul, This change
@@ -1780,8 +1627,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags, while (1) { struct globnames *old = names; - size_t i; - for (i = 0; i < cur; ++i) + for (size_t i = 0; i < cur; ++i) free (names->name[i]); names = names->next; /* NB: we will not leak memory here if we exit without @@ -1806,8 +1652,7 @@ glob_in_dir (const char *pattern, const char *directory, int flags, while (1) { struct globnames *old = names; - size_t i; - for (i = 0; i < cur; ++i) + for (size_t i = 0; i < cur; ++i) new_gl_pathv[pglob->gl_offs + pglob->gl_pathc++] = names->name[i]; names = names->next; causes a build failure of a testdir of module 'glob' on NetBSD 7 and OpenBSD 6. On NetBSD 7.0: gcc -DHAVE_CONFIG_H -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -I/home/bruno/include -Wall -g -O2 -MT glob.o -MD -MP -MF .deps/glob.Tpo -c -o glob.o ../../gllib/glob.c ../../gllib/glob.c: In function 'glob_in_dir': ../../gllib/glob.c:1630:15: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < cur; ++i) ^ ../../gllib/glob.c:1630:15: note: use option -std=c99 or -std=gnu99 to compile your code ../../gllib/glob.c:1655:15: error: 'for' loop initial declarations are only allowed in C99 mode for (size_t i = 0; i < cur; ++i) ^ *** Error code 1 On OpenBSD 6.0: gcc -DHAVE_CONFIG_H -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -I/home/bruno/include -Wall -g -O2 -MT glob.o -MD -MP -MF .deps/glob.Tpo -c -o glob.o ../../gllib/glob.c ../../gllib/glob.c: In function 'glob_in_dir': ../../gllib/glob.c:1630: error: 'for' loop initial declaration used outside C99 mode ../../gllib/glob.c:1655: error: 'for' loop initial declaration used outside C99 mode *** Error 1 in gllib (Makefile:1201 'glob.o') The following patch fixes it. 2017-08-24 Bruno Haible <br...@clisp.org> glob: Fix compilation error on NetBSD 7.0 and OpenBSD 6.0. * modules/glob (Depends-on): Add c99. diff --git a/modules/glob b/modules/glob index 0d64124..48cf387 100644 --- a/modules/glob +++ b/modules/glob @@ -12,6 +12,7 @@ lib/globfree.c m4/glob.m4 Depends-on: +c99 extensions largefile snippet/c++defs