]> Savannah Git Hosting - gnulib.git/log
gnulib.git
7 years agoImprove cross-compilation guesses for native Windows.
Bruno Haible [Thu, 13 Jul 2017 17:46:33 +0000 (19:46 +0200)]
Improve cross-compilation guesses for native Windows.

* m4/memchr.m4 (gl_FUNC_MEMCHR): Add cross-compilation guess for native
Windows.
* m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Don't use internals of
memchr.m4.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Likewise.

7 years agoImprove cross-compilation guesses for native Windows.
Bruno Haible [Thu, 13 Jul 2017 17:42:10 +0000 (19:42 +0200)]
Improve cross-compilation guesses for native Windows.

* m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): Add cross-compilation guess for
native Windows.
(gl_FUNC_FFLUSH): Update accordingly.
* m4/fclose.m4 (gl_FUNC_FCLOSE): Likewise.
* m4/fseeko.m4 (gl_FUNC_FFLUSH_STDIN): Likewise.

7 years agoMore systematic m4 quoting and indentation.
Bruno Haible [Tue, 11 Jul 2017 11:58:01 +0000 (13:58 +0200)]
More systematic m4 quoting and indentation.

* m4/chdir-long.m4 (gl_FUNC_CHDIR_LONG): Quote systematically.
* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Likewise.
* m4/d-type.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE): Likewise.
* m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise.
* m4/host-os.m4 (gl_HOST_OS): Likewise.
* m4/jm-winsz1.m4 (gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H,
gl_WINSIZE_IN_PTEM): Likewise.
* m4/mbrtowc.m4 (AC_FUNC_MBRTOWC): Likewise.
* m4/physmem.m4 (gl_SYS__SYSTEM_CONFIGURATION): Likewise.
* m4/pselect.m4 (gl_FUNC_PSELECT): Likewise.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): Quote systematically.
Correct indentation.
* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Likewise.
* m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
* m4/jm-winsz2.m4 (gl_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL): Likewise.
* m4/rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Likewise.
* m4/tzset.m4 (gl_FUNC_TZSET_CLOBBER): Likewise.
* m4/unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Likewise.

7 years agoround, roundf: Avoid compiler warning in configure test.
Bruno Haible [Tue, 11 Jul 2017 01:52:48 +0000 (03:52 +0200)]
round, roundf: Avoid compiler warning in configure test.

* m4/round.m4 (gl_FUNC_ROUND): Use 'return' instead of exit().
* m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise.

7 years agogetlogin tests: Avoid #ifdefs when sharing code between modules.
Bruno Haible [Mon, 10 Jul 2017 22:53:04 +0000 (00:53 +0200)]
getlogin tests: Avoid #ifdefs when sharing code between modules.

* modules/getlogin_r-tests (Files): Add tests/test-getlogin.h.
* modules/getlogin-tests (Files): Likewise. Remove
tests/test-getlogin_r.c.
* tests/test-getlogin.h: Extracted from tests/test-getlogin_r.c.
* tests/test-getlogin.c: Extracted from tests/test-getlogin_r.c.
* tests/test-getlogin_r.c: Include test-getlogin.h. Omit code that tests
getlogin().

7 years agogetlogin: don’t assume one name per uid
Paul Eggert [Mon, 10 Jul 2017 18:56:48 +0000 (11:56 -0700)]
getlogin: don’t assume one name per uid

Problem reported by Wolfgang F. Muthmann (Bug#27640).
* modules/getlogin-tests (Files): Add tests/test-getlogin_r.c.
(ttyname): Remove test.
* modules/getlogin_r-tests (ttyname): Remove test.
* tests/test-getlogin.c: Replace this near-clone of test-getlogin_r.c
with ‘#define TEST_LOGIN’ followed by ‘#include "test-getlogin_r.c"’.
* tests/test-getlogin_r.c: If TEST_GETLOGIN is defined, test
getlogin rather than getlogin_r.  This avoids code duplication.
(main): Use isatty and fstat rather than ttyname and stat.
Use getpwnam instead of getpwuid, to be portable to test platforms
that have multiple login names for the same uid.

7 years agoglob: Fix more memory leaks.
Tim Rühsen [Mon, 10 Jul 2017 17:02:19 +0000 (19:02 +0200)]
glob: Fix more memory leaks.

* lib/glob.c (glob): Use 'goto out' in order to free dirname before
returning.
Reported by Tim Rühsen.

7 years agoMake sure $host and $host_os are defined when used.
Bruno Haible [Mon, 10 Jul 2017 10:35:06 +0000 (12:35 +0200)]
Make sure $host and $host_os are defined when used.

* m4/argz.m4 (gl_FUNC_ARGZ): Require AC_CANONICAL_HOST.
* m4/closedir.m4 (gl_FUNC_CLOSEDIR): Likewise.
* m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise.
* m4/dirfd.m4 (gl_FUNC_DIRFD): Likewise.
* m4/expl.m4 (gl_FUNC_EXPL): Likewise.
* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Likewise.
* m4/lstat.m4 (gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Likewise.
* m4/opendir.m4 (gl_FUNC_OPENDIR): Likewise.
* m4/poll.m4 (gl_FUNC_POLL): Likewise.
* m4/pselect.m4 (gl_FUNC_PSELECT): Likewise.
* m4/ptsname.m4 (gl_FUNC_PTSNAME): Likewise.
* m4/relocatable.m4 (gl_RELOCATABLE_BODY): Likewise.
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Likewise.
* m4/ceill.m4 (gl_FUNC_CEILL): Require AC_CANONICAL_HOST outside the
m4_ifdef block.

7 years ago*printf: Fix cross-compilation guess for Solaris.
Bruno Haible [Mon, 10 Jul 2017 00:20:20 +0000 (02:20 +0200)]
*printf: Fix cross-compilation guess for Solaris.

* m4/printf.m4 (gl_PRINTF_DIRECTIVE_F): Fix copy-and-paste mistake from
2010-12-21.

7 years agovasnprintf: port to macOS 10.13
Bruno Haible [Fri, 7 Jul 2017 21:35:32 +0000 (23:35 +0200)]
vasnprintf: port to macOS 10.13

Improve comments in last commit.

7 years agovasnprintf: port to macOS 10.13
Paul Eggert [Fri, 7 Jul 2017 21:10:20 +0000 (14:10 -0700)]
vasnprintf: port to macOS 10.13

Problem reported by comex in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00056.html
* lib/vasnprintf.c (VASNPRINTF): Don’t use %n on macOS.

7 years agoimaxdiv tests: Fix logic.
Bruno Haible [Thu, 6 Jul 2017 23:40:07 +0000 (01:40 +0200)]
imaxdiv tests: Fix logic.

* tests/test-imaxdiv.c (main): Use == instead of =.
Reported by Coverity.

7 years agouninorm/filter: Fix use-after-free bug.
Bruno Haible [Thu, 6 Jul 2017 22:14:53 +0000 (00:14 +0200)]
uninorm/filter: Fix use-after-free bug.

* lib/uninorm/uninorm-filter.c (uninorm_filter_write): Maintain
sortbuf == filter->sortbuf invariant.
Reported by Coverity.

7 years agoglob: Fix more memory leaks.
Bruno Haible [Thu, 6 Jul 2017 21:21:49 +0000 (23:21 +0200)]
glob: Fix more memory leaks.

* lib/glob.c (glob): Free dirname before returning.
Reported by Coverity and Tim Rühsen.

7 years agoparse-datetime: fix uninit var bug
Paul Eggert [Thu, 6 Jul 2017 21:08:24 +0000 (14:08 -0700)]
parse-datetime: fix uninit var bug

Reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-07/msg00038.html
* lib/parse-datetime.y (parse_datetime2): Do not use
uninitialized.

7 years agodoc: Update for MSVC 14.
Bruno Haible [Wed, 5 Jul 2017 23:10:39 +0000 (01:10 +0200)]
doc: Update for MSVC 14.

* doc/posix-headers/*.texi: Add info about MSVC 14.
* doc/posix-functions/*.texi: Likewise.
* doc/pastposix-functions/*.texi: Likewise.
* doc/glibc-headers/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.

7 years agosched: Fix build failure on native Windows (regression from 2017-06-19).
Bruno Haible [Wed, 5 Jul 2017 22:02:32 +0000 (00:02 +0200)]
sched: Fix build failure on native Windows (regression from 2017-06-19).

* m4/sched_h.m4 (gl_SCHED_H): Set HAVE_STRUCT_SCHED_PARAM always.

7 years agoautoupdate
Karl Berry [Wed, 5 Jul 2017 16:03:45 +0000 (09:03 -0700)]
autoupdate

7 years agostdioext: Port to OpenVMS.
John Malmberg [Mon, 3 Jul 2017 13:05:19 +0000 (08:05 -0500)]
stdioext: Port to OpenVMS.

* lib/stdio-impl.h: OpenVMS uses struct _iobuf for FILE information.
* lib/fpending.c (fpending): Remove non-working VMS specific code.
* lib/fbufmode.c (fbufmode): Fix _IOLBF test to use fp_ macro.
* lib/fflush.c (clear_ungetc_buffer): Add OpenVMS to comments.
* lib/fpurge.c (fpurge): Likewise.
* lib/freadable.c (freadable): Likewise.
* lib/freadahead.c (freadahead): Likewise.
* lib/freading.c (freading): Likewise.
* lib/freadptr.c (freadptr): Likewise.
* lib/freadseek.c (freadseek): Likewise.
* lib/fseeko.c (fseeko): Likewise.
* lib/fseterr.c (fseterr): Likewise.
* lib/fwritable.c (fwriteable): Likewise.
* lib/fwriting.c (fwriting): Likewise.

7 years agoglob: Declare variables at the very start of their scope.
Benno Schulenberg [Sat, 1 Jul 2017 16:05:00 +0000 (18:05 +0200)]
glob: Declare variables at the very start of their scope.

* lib/glob.c (convert_dirent, convert_dirent64): Give each fragment
its separate scope, so the functions will compile on Haiku.

7 years agologbl: Work around a glibc bug on PowerPC64LE.
Bruno Haible [Sat, 1 Jul 2017 15:10:31 +0000 (17:10 +0200)]
logbl: Work around a glibc bug on PowerPC64LE.

* m4/logbl.m4 (gl_FUNC_LOGBL_WORKS): Test also negative subnormal
numbers.
* doc/posix-functions/logbl.texi: Update.

7 years agostat, fstat: Compile stat-w32.c only on platforms that need it.
Bruno Haible [Thu, 29 Jun 2017 15:36:28 +0000 (17:36 +0200)]
stat, fstat: Compile stat-w32.c only on platforms that need it.

Suggested by Paul Eggert.

* modules/stat (configure.ac): Request stat-w32.o only on native
Windows.
* modules/fstat (configure.ac): Likewise.

7 years agostat: Improve last change.
Bruno Haible [Sun, 25 Jun 2017 09:09:42 +0000 (11:09 +0200)]
stat: Improve last change.

* lib/stat-w32.c: Revert last change. Use generic idiom instead.

7 years agostat: port to xlc 12.01
Paul Eggert [Sun, 25 Jun 2017 07:06:15 +0000 (00:06 -0700)]
stat: port to xlc 12.01

* lib/stat-w32.c: Always include <sys/types.h>.  Otherwise, xlc
12.01 complains "Compilation unit is empty."

7 years agoxalloc-oversized: port to icc
Paul Eggert [Sun, 25 Jun 2017 06:48:31 +0000 (23:48 -0700)]
xalloc-oversized: port to icc

* lib/xalloc-oversized.h (xalloc_oversized): Do not use
__builtin_mul_overflow if ICC is defined, as this results in
"undefined reference to `__builtin_mul_overflow'" with icc 17.0.2
20170213.

7 years agoclasspath: Avoid including config.h twice, as it produces warnings.
Bruno Haible [Mon, 19 Jun 2017 15:09:30 +0000 (17:09 +0200)]
classpath: Avoid including config.h twice, as it produces warnings.

Reported by John E. Malmberg <wb8tyw@gmail.com>.

* lib/classpath.h: Conditionalize the include of config.h.

7 years agosched: Fix compilation failure on OpenVMS.
Bruno Haible [Mon, 19 Jun 2017 14:54:55 +0000 (16:54 +0200)]
sched: Fix compilation failure on OpenVMS.

* m4/sched_h.m4 (gl_SCHED_H): Require AC_CANONICAL_HOST. On OpenVMS,
test whether <pthread.h> exists and defines struct sched_param.
* lib/sched.in.h: On OpenVMS, include <pthread.h>.

7 years agodiffseq: port to GCC 7 with --enable-gcc-warnings
Paul Eggert [Sat, 17 Jun 2017 19:16:27 +0000 (12:16 -0700)]
diffseq: port to GCC 7 with --enable-gcc-warnings

* lib/diffseq.h (diag): Use an if, not an ifdef, for most of the
heuristic check.  This way, GCC 7 with --enable-gcc-warnings does
not complain about big_snake being defined but not used.

7 years agogettext-h: Update theoretical condition for use of variable size arrays.
Bruno Haible [Thu, 15 Jun 2017 20:58:28 +0000 (22:58 +0200)]
gettext-h: Update theoretical condition for use of variable size arrays.

Reported by Paul Eggert.

* lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Extend comment
to include the theoretical condition for availability of variable size
arrays, if we could trust the value of __STDC_VERSION__.

7 years agoRelicense some modules under LGPLv2+.
Bruno Haible [Mon, 12 Jun 2017 08:40:29 +0000 (10:40 +0200)]
Relicense some modules under LGPLv2+.

Daiki Ueno's approval is in
https://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00058.html.

* modules/uniwidth/base (License): Change to LGPLv2+.
* modules/uniwidth/width (License): Likewise.

7 years agolocalename: Fix test failure on DragonFly BSD.
Bruno Haible [Mon, 12 Jun 2017 00:05:17 +0000 (02:05 +0200)]
localename: Fix test failure on DragonFly BSD.

* lib/localename.c (gl_locale_name_thread_unsafe): Treat DragonFly BSD
like FreeBSD.

7 years agofloat: Fix 'float' and 'isinf' failures on DragonFly BSD.
Bruno Haible [Sun, 11 Jun 2017 23:57:02 +0000 (01:57 +0200)]
float: Fix 'float' and 'isinf' failures on DragonFly BSD.

* m4/fmal.m4, m4/frexpl.m4, m4/logbl.m4: Update accordingly.

7 years agofloat: Fix 'float' and 'isinf' failures on DragonFly BSD.
Bruno Haible [Sun, 11 Jun 2017 23:45:46 +0000 (01:45 +0200)]
float: Fix 'float' and 'isinf' failures on DragonFly BSD.

* m4/float_h.m4 (gl_FLOAT_H): Treat DragonFly BSD like FreeBSD.
* lib/float.in.h: Likewise.

7 years agognulib-tool: Clean up after autotools.
Bruno Haible [Sun, 11 Jun 2017 23:38:57 +0000 (01:38 +0200)]
gnulib-tool: Clean up after autotools.

* gnulib-tool (func_create_testdir, func_create_megatestdir): Remove
useless directory left over by the Autotools.

7 years agogetopt-posix: port to glibc 2.25.90
Paul Eggert [Sun, 11 Jun 2017 22:53:09 +0000 (15:53 -0700)]
getopt-posix: port to glibc 2.25.90

Problem reported by Daniel P. Berrange in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00003.html
* lib/getopt-pfx-core.h (_GETOPT_CORE_H):
* lib/getopt-pfx-ext.h (_GETOPT_EXT_H):
#undef if __GETOPT_PREFIX is defined.

7 years agostrtod-obsolete: Fix license.
Bruno Haible [Sun, 11 Jun 2017 11:09:47 +0000 (13:09 +0200)]
strtod-obsolete: Fix license.

* modules/strtod-obsolete (License): Change to LGPL.

7 years agomaint: update to work with GCC7's -Werror=implicit-fallthrough=
Jim Meyering [Sat, 10 Jun 2017 17:11:47 +0000 (10:11 -0700)]
maint: update to work with GCC7's -Werror=implicit-fallthrough=

* lib/savewd.c (FALLTHROUGH): Define.
(savewd_save, savewd_restore): Use this, rather than a comment,
whenever one switch case falls through into the next.

7 years agohost-cpu-c-abi: Support for aarch64 ILP32 ABI.
Bruno Haible [Thu, 8 Jun 2017 23:26:28 +0000 (01:26 +0200)]
host-cpu-c-abi: Support for aarch64 ILP32 ABI.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Recognize the aarch64 ILP32
ABI. Set HOST_CPU_C_ABI=arm64-ilp32 and define __arm64_ilp32__ in this
case.

7 years ago* doc/build-automation.texi: Mention DEPENDENCIES.
Paul Eggert [Thu, 8 Jun 2017 16:27:36 +0000 (09:27 -0700)]
* doc/build-automation.texi: Mention DEPENDENCIES.

7 years agodoc: remove robots, add prereqs
Paul Eggert [Thu, 8 Jun 2017 14:34:47 +0000 (07:34 -0700)]
doc: remove robots, add prereqs

* doc/build-automation.texi, doc/gnulib.texi: Mention prereqs for
builds.  Simon's robot site does not seem to be up, so remove
mentions of it for now.

7 years agognulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.
Bruno Haible [Thu, 8 Jun 2017 13:09:31 +0000 (15:09 +0200)]
gnulib-tool: Fix bug in func_symlink_if_changed, from 2006-11-13.

* gnulib-tool (func_symlink_target): New function, extracted from
func_symlink.
(func_symlink, func_symlink_if_changed): Use it.

7 years agognulib-tool: Fix bug in func_ln_s, from 2016-01-15.
Bruno Haible [Thu, 8 Jun 2017 12:45:39 +0000 (14:45 +0200)]
gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.

* gnulib-tool (func_ln_s): Determine cp_src correctly.

7 years agocanonicalize-lgpl: Avoid conflict with gnulib 'getcwd' module on VMS.
Bruno Haible [Wed, 7 Jun 2017 13:23:38 +0000 (15:23 +0200)]
canonicalize-lgpl: Avoid conflict with gnulib 'getcwd' module on VMS.

Reported by John E. Malmberg <wb8tyw@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00029.html>.
* lib/canonicalize-lgpl.c (__getcwd): On VMS, when using gnulib's getcwd
override, pass 2 arguments to getcwd, not 3.

7 years agoautoupdate
Karl Berry [Mon, 5 Jun 2017 13:46:00 +0000 (06:46 -0700)]
autoupdate

7 years agosame-inode: port better to VMS 8.2 and later
Paul Eggert [Sun, 4 Jun 2017 21:25:43 +0000 (14:25 -0700)]
same-inode: port better to VMS 8.2 and later

Problem reported by John E. Malmberg in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00005.html
* lib/same-inode.h (SAME_INODE) [__VMS && 80200000 <= __CRTL_VER]:
Use the usual POSIX definition.
* m4/sys_types_h.m4 (gl_SYS_TYPES_H): Define _USE_STD_STAT.

7 years agoerror: fix POSIX violation for va_end
Paul Eggert [Thu, 1 Jun 2017 21:08:00 +0000 (14:08 -0700)]
error: fix POSIX violation for va_end

Problem reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00001.html
* lib/error.c (error_tail): Do not call va_end here.
(error, error_at_line): Call it here instead.

7 years agoautoupdate
Karl Berry [Sun, 28 May 2017 15:43:13 +0000 (08:43 -0700)]
autoupdate

7 years agoc-strtod: Make it usable in C++ mode.
Bruno Haible [Sun, 28 May 2017 11:51:08 +0000 (13:51 +0200)]
c-strtod: Make it usable in C++ mode.

* lib/c-strtod.h: Add 'extern "C"' marker for C++.

7 years agoquotearg: fix compilation failure due to FALLTHROUGH misuse
Jim Meyering [Fri, 26 May 2017 04:25:37 +0000 (21:25 -0700)]
quotearg: fix compilation failure due to FALLTHROUGH misuse

* lib/quotearg.c (quotearg_buffer_restyled): Revert one FALLTHROUGH
macro back to /* fall through */ comment.  The macro can apply only
to a following case statement.  Reported by Assaf Gordon.

7 years agointprops: port to recent icc
Paul Eggert [Thu, 25 May 2017 07:08:09 +0000 (00:08 -0700)]
intprops: port to recent icc

Port to icc (ICC) 17.0.4 20170411, which defines __GNUC__ to be 5
but does not support __builtin_add_overflow etc.
* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW) [__ICC]:
Define to 0.

7 years agoiconv.m4 sync broken
Karl Berry [Tue, 23 May 2017 21:39:55 +0000 (14:39 -0700)]
iconv.m4 sync broken

7 years agoiconv: Update copyright year.
Bruno Haible [Tue, 23 May 2017 16:56:39 +0000 (18:56 +0200)]
iconv: Update copyright year.

Reported by Karl Berry.

7 years agoFix ChangeLog formatting.
Bruno Haible [Mon, 22 May 2017 20:26:29 +0000 (22:26 +0200)]
Fix ChangeLog formatting.

7 years agoRemove repeated words in comments.
Bjarni Ingi Gislason [Mon, 22 May 2017 18:02:35 +0000 (18:02 +0000)]
Remove repeated words in comments.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
7 years agofallthrough: reinstate a FALLTHROUGH instance in quotearg
Bernhard Voelker [Mon, 22 May 2017 11:45:45 +0000 (12:45 +0100)]
fallthrough: reinstate a FALLTHROUGH instance in quotearg

quotearg.c: Reinstate this instance which is significant
when the if branch is not taken.

7 years agognulib-tool: Add options to create hard links.
Bruno Haible [Sun, 21 May 2017 23:39:59 +0000 (01:39 +0200)]
gnulib-tool: Add options to create hard links.

* gnulib-tool (func_usage): Document options --hardlink,
--local-hardlink, --more-hardlinks.
(func_symlink): Renamed from func_ln.
(func_symlink_if_changed): Renamed from func_ln_if_changed.
(func_hardlink): New function.
(copymode, lcopymode): New variables.
(symbolic, lsymbolic): Remove variables.
(Options): Implement options --hardlink, --local-hardlink,
--more-hardlinks.
(func_should_link): Renamed from func_should_symlink. Set copyaction.
(func_add_file, func_update_file): Update invocation of
func_should_link. Invoke func_hardlink when appropriate.
(func_import): Update comments.
(func_create_testdir): Update invocation of func_should_link. Invoke
func_hardlink when appropriate.
Finally, invoke 'git update-index --refresh' to mitigate the effects of
the hard links on git.

7 years agoargp: Simplify bit manipulation.
Bruno Haible [Sun, 21 May 2017 00:46:18 +0000 (02:46 +0200)]
argp: Simplify bit manipulation.

* lib/argp-parse.c (parser_parse_opt): Use &, |, ~ instead of shifts
on a signed integer type.

7 years agoAvoid wrong configure results with gcc -fsanitize=address.
Bruno Haible [Sat, 20 May 2017 13:26:26 +0000 (15:26 +0200)]
Avoid wrong configure results with gcc -fsanitize=address.

This completes the work done on 2016-02-06 on this topic.

* m4/memmem.m4 (gl_FUNC_MEMMEM): Free allocated memory before returning.
* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Likewise.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR): Likewise.
* m4/strstr.m4 (gl_FUNC_STRSTR): Likewise.
* m4/fopen.m4 (gl_FUNC_FOPEN): Close allocated FILE streams before
returning.
* m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): Likewise.
* m4/fpurge.m4 (gl_FUNC_FPURGE): Likewise.
* m4/ftello.m4 (gl_FUNC_FTELLO): Likewise.
* m4/rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Likewise.
* m4/signbit.m4 (gl_FLOATTYPE_SIGN_LOCATION): Likewise.
* m4/ungetc.m4 (gl_FUNC_UNGETC_WORKS): Likewise.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Close allocated FILE streams and
free allocated memory before returning.
* m4/getline.m4 (gl_FUNC_GETLINE): Likewise.
* m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): Close allocated DIR
objects before returning.
* m4/iconv.m4 (AM_ICONV_LINK): Close allocated iconv_t handles before
returning.

7 years agognulib-tool: Don't create hard links between gnulib and its testdirs.
Bruno Haible [Sat, 20 May 2017 11:24:37 +0000 (13:24 +0200)]
gnulib-tool: Don't create hard links between gnulib and its testdirs.

* gnulib-tool (func_create_testdir): Don't invoke 'ln'.

7 years agoargp, tsearch tests: Fix file list.
Bruno Haible [Sat, 20 May 2017 10:15:04 +0000 (12:15 +0200)]
argp, tsearch tests: Fix file list.

* modules/argp-tests (Files): Add tests/macros.h.
* modules/tsearch-tests (Files): Likewise.

7 years agogetopt-posix tests: Remove redundant include.
Bruno Haible [Sat, 20 May 2017 10:12:16 +0000 (12:12 +0200)]
getopt-posix tests: Remove redundant include.

* tests/test-getopt.h: Don't include "macros.h". It's already included
by tests/test-getopt-main.h.

7 years agodfa: two small simplifications
Jim Meyering [Sat, 20 May 2017 00:02:56 +0000 (17:02 -0700)]
dfa: two small simplifications

* lib/dfa.c (build_state): Avoid repeating longer expressions.

7 years agofallthrough: update for GCC 7/8
Jim Meyering [Thu, 18 May 2017 15:36:27 +0000 (08:36 -0700)]
fallthrough: update for GCC 7/8

* lib/quotearg.c (FALLTHROUGH): New macro.
Use it whenever one switch case falls through into the next,
replacing "/* Fall through */" comments.  This exposed one
instance of an unwarranted "fall through" comment: unwarranted
because it preceded a "goto" label not a case statement.
* lib/freopen-safer.c (freopen_safer): Likewise.
* lib/fts.c (leaf_optimization_applies): Likewise.
* lib/unistr/u8-uctomb-aux.c (u8_uctomb_aux): Likewise.
* tests/test-getopt_long.h (getopt_long_loop): Likewise.
* tests/test-tsearch.c (mangle_tree): Likewise.  Also include
tests/macros.h for the definition.
* tests/test-argp.c (group1_parser): Likewise.
* tests/test-getopt.h (getopt_loop): Likewise.

7 years agoargp: fix shift bug
Paul Eggert [Fri, 19 May 2017 22:39:06 +0000 (15:39 -0700)]
argp: fix shift bug

* lib/argp-parse.c (parser_parse_opt): Rework to avoid undefined
behavior on shift overflow, caught by gcc -fsanitize=undefined.

7 years agoargp: fix pointer-subtraction bug
Paul Eggert [Fri, 19 May 2017 22:35:24 +0000 (15:35 -0700)]
argp: fix pointer-subtraction bug

* lib/argp-help.c (hol_append): Don’t subtract pointers to
different arrays, as this can run afoul of -fcheck-pointer-bounds.
See the thread containing Bruno Haible’s report in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-05/msg00171.html

7 years agoprintf-posix tests: Avoid test failure with "gcc --coverage".
Bruno Haible [Fri, 19 May 2017 17:27:51 +0000 (19:27 +0200)]
printf-posix tests: Avoid test failure with "gcc --coverage".

Reported by Tim Rühsen <tim.ruehsen@gmx.de>.

* tests/test-printf-posix2.c (main): Test a width of 10000000 rather
than 5000000.
* tests/test-fprintf-posix2.c (main): Likewise.

7 years agocloseout: don’t close stderr when sanitizing
Paul Eggert [Fri, 19 May 2017 15:52:38 +0000 (08:52 -0700)]
closeout: don’t close stderr when sanitizing

* NEWS: Document this.
* lib/closeout.c (__has_feature): New macro, if not already defined.
(SANITIZE_ADDRESS): New constant.
(close_stdout): Don’t close stderr if sanitizing addresses.

7 years agoget-rusage-data tests: Avoid failure on Linux/glibc.
Bruno Haible [Fri, 19 May 2017 07:06:39 +0000 (09:06 +0200)]
get-rusage-data tests: Avoid failure on Linux/glibc.

* tests/test-get-rusage-data.c (main): Don't expect a strict increase
on glibc systems.

7 years agolocalename: Include necessary header files on Cygwin.
Bruno Haible [Thu, 18 May 2017 22:50:38 +0000 (00:50 +0200)]
localename: Include necessary header files on Cygwin.

* lib/localename.c [__CYGWIN__]: Include <langinfo.h>, since this is
where NL_LOCALE_NAME is defined.

7 years agogettext: Update macros from gettext git.
Bruno Haible [Thu, 18 May 2017 20:49:58 +0000 (22:49 +0200)]
gettext: Update macros from gettext git.

* m4/intldir.m4: Require Autoconf >= 2.60.
* m4/progtest.m4: Fix typos in copyright notice.

7 years agocopy-file tests: Fix link error (regression from 2017-05-01).
Bruno Haible [Thu, 18 May 2017 20:20:58 +0000 (22:20 +0200)]
copy-file tests: Fix link error (regression from 2017-05-01).

Reported by Tom G. Christensen <tgc@jupiterrise.com>.

* modules/copy-file-tests (Makefile.am): Link test-copy-file with
$(LIB_CLOCK_GETTIME).

7 years agounicase/special-casing: Fix incompatibility with gperf-3.0.4.
Bruno Haible [Thu, 18 May 2017 10:54:51 +0000 (12:54 +0200)]
unicase/special-casing: Fix incompatibility with gperf-3.0.4.

* lib/unicase/special-casing.in.h: Renamed from
lib/unicase/special-casing.h.
* modules/unicase/special-casing (Files): Add
lib/unicase/special-casing.in.h. Remove lib/unicase/special-casing.h.
(Makefile.am): Add rule for generating unicase/special-casing.h.
Update BUILT_SOURCES and MOSTLYCLEANFILES accordingly.
* lib/unicase/special-casing.c: Include "unicase/special-casing.h",
not "special-casing.h".
* lib/unicase/u*.c: Likewise.

7 years agoREADME: Don't ask people to read a TeXinfo file.
Bruno Haible [Wed, 17 May 2017 08:14:07 +0000 (10:14 +0200)]
README: Don't ask people to read a TeXinfo file.

Reported by Tim Rühsen <tim.ruehsen@gmx.de>.

* README: Tell people how to read the HTML formatted manual.

7 years agoparse-datetime: Fix memleak
Tim Rühsen [Wed, 17 May 2017 08:02:39 +0000 (10:02 +0200)]
parse-datetime: Fix memleak

* lib/parse-datetime.y (parse_datetime2): Cleanup on
localtime_rz() failure.

7 years agojavacomp: Fix handle leak.
Bruno Haible [Tue, 16 May 2017 19:29:32 +0000 (21:29 +0200)]
javacomp: Fix handle leak.

Found by Coverity.

* lib/javacomp.c (get_classfile_version): Close fd before returning.

7 years agorelocate: Make it easier to reclaim allocated memory.
Bruno Haible [Tue, 16 May 2017 18:57:23 +0000 (20:57 +0200)]
relocate: Make it easier to reclaim allocated memory.

* lib/relocatable.h (relocate2): New declaration/macro.
* lib/relocatable.c (relocate2): New function.
* doc/relocatable-maint.texi (Supporting Relocation): Mention the
relocate2 function.
* lib/localcharset.c (relocate2): Define fallback.
(get_charset_aliases): Invoke relocate2 instead of relocate. Free the
allocated memory.
* lib/javaversion.c (relocate2): Define fallback.
(javaexec_version): Invoke relocate2 instead of relocate. Free the
allocated memory.

7 years agorelocate: Simplify EMX specific code.
Bruno Haible [Tue, 16 May 2017 18:02:20 +0000 (20:02 +0200)]
relocate: Simplify EMX specific code.

* lib/relocatable.c (relocate): Assume pathname is non-NULL. Use
ISSLASH macro consistently. Avoid dangerous string concatenation idiom.

7 years agosigpipe tests: Fix file list.
Bruno Haible [Tue, 16 May 2017 17:38:06 +0000 (19:38 +0200)]
sigpipe tests: Fix file list.

* modules/sigpipe-tests (Files): Add tests/macros.h.

7 years agomanywarnings: update for GCC 7
Paul Eggert [Tue, 16 May 2017 16:23:52 +0000 (09:23 -0700)]
manywarnings: update for GCC 7

* build-aux/gcc-warning.spec:
* m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC):
Add GCC 7 warnings, notably -Wimplicit-fallthrough=5, which
requires a non-comment fallthrough attribute.  This is a bit
cleaner than the comment versions.
* lib/strftime.c, lib/dfa.c, lib/fnmatch.c, lib/mbrtowc.c:
* lib/vasnprintf.c, tests/macros.h (FALLTHROUGH): New macro.
Use it whenever one switch case falls through into the next.

7 years agognulib-tool: Fix generated code when libtests contains module 'alloca'.
Bruno Haible [Mon, 15 May 2017 21:13:57 +0000 (23:13 +0200)]
gnulib-tool: Fix generated code when libtests contains module 'alloca'.

* gnulib-tool (func_emit_tests_Makefile_am): For libtests.a, use
@ALLOCA@, not @LTALLOCA@.

7 years agosys_select: Avoid "was expanded before it was required" warning.
Bruno Haible [Mon, 15 May 2017 17:27:45 +0000 (19:27 +0200)]
sys_select: Avoid "was expanded before it was required" warning.

* modules/sys_select (configure.ac): Require, not invoke,
gl_HEADER_SYS_SELECT.

7 years agoautoupdate
Karl Berry [Mon, 15 May 2017 15:35:02 +0000 (08:35 -0700)]
autoupdate

7 years agognulib-tool: improve GNU Make debugging
Paul Eggert [Mon, 15 May 2017 14:41:10 +0000 (07:41 -0700)]
gnulib-tool: improve GNU Make debugging

* gnulib-tool (func_emit_lib_Makefile_am): Omit unnecessary echo.
Report autoconf diagnostics when it fails, in the output makefile.

7 years agostat-time tests: Improve comment.
Bruno Haible [Sun, 14 May 2017 19:32:41 +0000 (21:32 +0200)]
stat-time tests: Improve comment.

* tests/test-stat-time.c: Add hyperlink, from Paul Eggert.

7 years agosame-inode: Adapt for windows-stat-inodes.
Bruno Haible [Sun, 14 May 2017 15:33:37 +0000 (17:33 +0200)]
same-inode: Adapt for windows-stat-inodes.

* lib/same-inode.h: Include <sys/types.h>.
(SAME_INODE) [_GL_WINDOWS_STAT_INODES]: Define specifically.
* modules/same-inode (Depends-on): Add sys_types.

7 years agowindows-stat-inodes: New module.
Bruno Haible [Sun, 14 May 2017 12:20:01 +0000 (14:20 +0200)]
windows-stat-inodes: New module.

* m4/windows-stat-inodes.m4: New file.
* m4/sys_types_h.m4 (gl_SYS_TYPES_H): Set WINDOWS_STAT_INODES.
* modules/sys_types (Makefile.am): Substitute WINDOWS_STAT_INODES.
* lib/sys_types.in.h [WINDOWS_STAT_INODES]: Override dev_t and ino_t.
(_GL_WINDOWS_STAT_INODES): New macro.
* lib/stat-w32.c: Set _WIN32_WINNT. Include <string.h>, verify.h.
(GetFileInformationByHandleExFunc): New variable.
(initialize): Initialize it.
(_gl_fstat_by_handle) [_GL_WINDOWS_STAT_INODES]: Initialize st_dev and
st_ino appropriately.
* lib/stat.c (rpl_stat): Use the directory entry based approach only as
a fallback, because it does not provide st_dev and st_ino values.
* modules/fstat (Depends-on): Add 'verify'.
* modules/windows-stat-inodes: New file.
* doc/windows-stat-inodes.texi: New file.
* doc/gnulib.texi: Include it.
* doc/posix-headers/sys_stat.texi: Mention the new module.

7 years agostat-time tests: Workaround for native Windows.
Bruno Haible [Sun, 14 May 2017 15:37:31 +0000 (17:37 +0200)]
stat-time tests: Workaround for native Windows.

* tests/test-stat-time.c: Include <stdio.h>, <time.h>.
(filename_stamp1, filename_testfile, filename_stamp2, filename_stamp3):
New variables.
(initialize_filenames): New function.
(main): Invoke it.
(cleanup, prepare_test): Update.

7 years agostat-time: Adapt for windows-stat-timespec.
Bruno Haible [Sun, 14 May 2017 15:35:16 +0000 (17:35 +0200)]
stat-time: Adapt for windows-stat-timespec.

* lib/stat-time.h (get_stat_birthtime) [_GL_WINDOWS_STAT_TIMESPEC]: Use
entire st_ctim field.

7 years agomaint.mk: update regex to reflect 2013 addition of "assume" to verify.h
Jim Meyering [Sun, 14 May 2017 01:18:22 +0000 (18:18 -0700)]
maint.mk: update regex to reflect 2013 addition of "assume" to verify.h

* top/maint.mk (sc_prohibit_verify_without_use): Don't reject a source
file that uses the assume macro, claiming that verify.h is unused.

7 years agoUse symbolic values for _WIN32_WINNT.
Bruno Haible [Sat, 13 May 2017 11:07:26 +0000 (13:07 +0200)]
Use symbolic values for _WIN32_WINNT.

* lib/ftruncate.c (_WIN32_WINNT): Use symbolic value _WIN32_WINNT_WIN2K.
* lib/sethostname.c (_WIN32_WINNT): Likewise.

7 years agoyear2038: New module.
Bruno Haible [Sat, 13 May 2017 01:04:54 +0000 (03:04 +0200)]
year2038: New module.

* m4/year2038.m4: New file.
* modules/year2038: New file.
* doc/year2038.texi: New file.
* doc/gnulib.texi: Include it.

7 years agolargefile: Simplify.
Bruno Haible [Sat, 13 May 2017 08:35:06 +0000 (10:35 +0200)]
largefile: Simplify.

* m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Remove unused definition
of _GL_WINDOWS_64_BIT_ST_SIZE.

7 years agolargefile: Improve and document.
Bruno Haible [Sat, 13 May 2017 01:03:07 +0000 (03:03 +0200)]
largefile: Improve and document.

* m4/largefile.m4 (gl_LARGEFILE): Set WINDOWS_64_BIT_ST_SIZE to 0 if
the mingw headers already define 'stat' appropriately.
* modules/largefile (Description): Clarify.
* doc/largefile.texi: New file.
* doc/gnulib.texi: Include it.
* doc/posix-headers/sys_types.texi: Update.

7 years agotruncate-tests: New module.
Bruno Haible [Sat, 13 May 2017 00:55:24 +0000 (02:55 +0200)]
truncate-tests: New module.

* tests/test-truncate.c: New file.
* modules/truncate-tests: New file.

7 years agotruncate: New module.
Bruno Haible [Sat, 13 May 2017 00:54:37 +0000 (02:54 +0200)]
truncate: New module.

* lib/unistd.in.h (truncate): New declaration.
* lib/truncate.c: New file.
* m4/truncate.m4: New file.
* m4/unistd_h.m4 (gl_UNISTD_H): Test whether 'truncate' is declared.
(gl_UNISTD_H_DEFAULTS): Initialize GNULIB_TRUNCATE, HAVE_TRUNCATE,
REPLACE_TRUNCATE.
* modules/unistd (Makefile.am): Substitute GNULIB_TRUNCATE,
HAVE_TRUNCATE, REPLACE_TRUNCATE.
* modules/truncate: New file.
* tests/test-unistd-c++.cc (truncate): Test signature.
* doc/posix-functions/truncate.texi: Mention the new module.

7 years agowindows-stat-timespec: New module.
Bruno Haible [Sat, 13 May 2017 00:51:05 +0000 (02:51 +0200)]
windows-stat-timespec: New module.

* modules/windows-stat-timespec: New file.
* m4/windows-stat-timespec.m4: New file.
* m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Set WINDOWS_STAT_TIMESPEC.
* modules/sys_stat (Makefile.am): Substitute WINDOWS_STAT_TIMESPEC.
* lib/sys_stat.in.h (struct stat) [WINDOWS_STAT_TIMESPEC]: Declare with
fields st_atim, st_mtim, st_ctim.
(st_atime, st_mtime, st_ctime): Define as macros.
(_GL_WINDOWS_STAT_TIMESPEC): New macro.
* lib/stat-w32.h (_gl_convert_FILETIME_to_timespec)
[_GL_WINDOWS_STAT_TIMESPEC]: New declaration.
* lib/stat-w32.c (_gl_convert_FILETIME_to_timespec)
[_GL_WINDOWS_STAT_TIMESPEC]: New function.
(_gl_convert_FILETIME_to_POSIX): Adjust coding style.
(_gl_fstat_by_handle): If _GL_WINDOWS_STAT_TIMESPEC, convert the
FILETIME to 'struct timespec', not 'time_t'.
* lib/stat.c (rpl_stat): If _GL_WINDOWS_STAT_TIMESPEC, convert the
FILETIME to 'struct timespec', not 'time_t'.
* lib/stat-time.h (STAT_TIMESPEC): Define also if
_GL_WINDOWS_STAT_TIMESPEC.
* doc/windows-stat-timespec.texi: New file.
* doc/gnulib.texi: Include it.

7 years agowindows-stat-override: New module.
Bruno Haible [Sat, 13 May 2017 00:46:43 +0000 (02:46 +0200)]
windows-stat-override: New module.

* lib/sys_stat.in.h (stat) [GNULIB_OVERRIDES_STRUCT_STAT]: Provide own
definition. Define GNULIB_defined_struct_stat.
(fstat, fstatat, lstat, stat) [GNULIB_OVERRIDES_STRUCT_STAT]: Provoke
link error if this symbol is used and the corresponding module is not
in use.
(_stat64, _stat32i64, _stati64, _stat32, _stat64i32): Don't redefine if
GNULIB_OVERRIDES_STRUCT_STAT.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Initialize
GNULIB_OVERRIDES_STRUCT_STAT.
* modules/sys_stat (Makefile.am): Substitute
GNULIB_OVERRIDES_STRUCT_STAT.
* modules/windows-stat-override: New file.

7 years agofstat: Fix module dependency conditions.
Bruno Haible [Sat, 13 May 2017 00:39:00 +0000 (02:39 +0200)]
fstat: Fix module dependency conditions.

* modules/fstat (Depends-on): Fix typo.

7 years agostat, fstat: Complete removal of old native Windows code.
Bruno Haible [Sat, 13 May 2017 00:36:19 +0000 (02:36 +0200)]
stat, fstat: Complete removal of old native Windows code.

* lib/stat.c: Remove old macrology for WINDOWS_NATIVE.
* lib/fstat.c: Likewise.
* lib/stat-w32.c: Likewise.

7 years agostat: Complete removal of REPLACE_FUNC_STAT_DIR code.
Bruno Haible [Sat, 13 May 2017 00:32:24 +0000 (02:32 +0200)]
stat: Complete removal of REPLACE_FUNC_STAT_DIR code.

* lib/stat.c: Remove all REPLACE_FUNC_STAT_DIR code.