10712 Commits
Author SHA1 Message Date
Bruno Haible abdd68df1a Fix ChangeLog formatting. 2017-05-22 22:31:04 +02:00
Bjarni Ingi Gislason 2b10299b2a Remove repeated words in comments.
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2017-05-22 22:10:07 +02:00
Bernhard Voelker 949b6cc651 fallthrough: reinstate a FALLTHROUGH instance in quotearg
quotearg.c: Reinstate this instance which is significant
when the if branch is not taken.
2017-05-22 12:48:31 +01:00
Bruno Haible 306be564ba 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.
2017-05-22 01:39:59 +02:00
Bruno Haible 88033d3779 argp: Simplify bit manipulation.
* lib/argp-parse.c (parser_parse_opt): Use &, |, ~ instead of shifts
on a signed integer type.
2017-05-21 02:46:18 +02:00
Bruno Haible 9c6d8d0b46 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.
2017-05-20 15:26:26 +02:00
Bruno Haible f5142421c6 gnulib-tool: Don't create hard links between gnulib and its testdirs.
* gnulib-tool (func_create_testdir): Don't invoke 'ln'.
2017-05-20 13:24:37 +02:00
Bruno Haible 4cb5b9b43e argp, tsearch tests: Fix file list.
* modules/argp-tests (Files): Add tests/macros.h.
* modules/tsearch-tests (Files): Likewise.
2017-05-20 12:15:04 +02:00
Bruno Haible 2c9d419103 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.
2017-05-20 12:12:16 +02:00
Jim Meyering 809f19dba7 dfa: two small simplifications
* lib/dfa.c (build_state): Avoid repeating longer expressions.
2017-05-19 17:02:56 -07:00
Jim Meyering 11fdf80b21 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.
2017-05-19 16:47:09 -07:00
Paul Eggert 06094e390b argp: fix shift bug
* lib/argp-parse.c (parser_parse_opt): Rework to avoid undefined
behavior on shift overflow, caught by gcc -fsanitize=undefined.
2017-05-19 15:39:44 -07:00
Paul Eggert a50e906c0c 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
2017-05-19 15:36:21 -07:00
Bruno Haible 5e0faf8871 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.
2017-05-19 19:27:51 +02:00
Paul Eggert 105ff45093 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.
2017-05-19 08:56:01 -07:00
Bruno Haible fa529e849b 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.
2017-05-19 09:06:39 +02:00
Bruno Haible c132245165 localename: Include necessary header files on Cygwin.
* lib/localename.c [__CYGWIN__]: Include <langinfo.h>, since this is
where NL_LOCALE_NAME is defined.
2017-05-19 00:50:38 +02:00
Bruno Haible 05daec7dcc gettext: Update macros from gettext git.
* m4/intldir.m4: Require Autoconf >= 2.60.
* m4/progtest.m4: Fix typos in copyright notice.
2017-05-18 22:49:58 +02:00
Bruno Haible a85305cbd7 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).
2017-05-18 22:20:58 +02:00
Bruno Haible 4be488081b 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.
2017-05-18 12:54:51 +02:00
Bruno Haible ac5fcbdf70 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.
2017-05-17 10:14:37 +02:00
Tim Rühsen 99eb841591 parse-datetime: Fix memleak
* lib/parse-datetime.y (parse_datetime2): Cleanup on
localtime_rz() failure.
2017-05-17 10:02:39 +02:00
Bruno Haible b82b383532 javacomp: Fix handle leak.
Found by Coverity.

* lib/javacomp.c (get_classfile_version): Close fd before returning.
2017-05-16 21:29:32 +02:00
Bruno Haible 3a285f29fb 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.
2017-05-16 20:57:23 +02:00
Bruno Haible 88fdf7f84a relocate: Simplify EMX specific code.
* lib/relocatable.c (relocate): Assume pathname is non-NULL. Use
ISSLASH macro consistently. Avoid dangerous string concatenation idiom.
2017-05-16 20:02:20 +02:00
Bruno Haible 90d982861b sigpipe tests: Fix file list.
* modules/sigpipe-tests (Files): Add tests/macros.h.
2017-05-16 19:38:06 +02:00
Paul Eggert 5e22aee79f 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.
2017-05-16 09:32:31 -07:00
Bruno Haible 0414a24cf5 gnulib-tool: Fix generated code when libtests contains module 'alloca'.
* gnulib-tool (func_emit_tests_Makefile_am): For libtests.a, use
@ALLOCA@, not @LTALLOCA@.
2017-05-15 23:13:57 +02:00
Bruno Haible 451d8ab5c9 sys_select: Avoid "was expanded before it was required" warning.
* modules/sys_select (configure.ac): Require, not invoke,
gl_HEADER_SYS_SELECT.
2017-05-15 19:27:45 +02:00
Paul Eggert 8224d65142 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.
2017-05-15 07:43:11 -07:00
Bruno Haible da830b5146 stat-time tests: Improve comment.
* tests/test-stat-time.c: Add hyperlink, from Paul Eggert.
2017-05-14 21:32:41 +02:00
Bruno Haible 0e9b97cffc 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.
2017-05-14 17:38:24 +02:00
Bruno Haible 8123b614e6 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.
2017-05-14 17:38:24 +02:00
Bruno Haible d75a6cfc41 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.
2017-05-14 17:38:23 +02:00
Bruno Haible 5f1eef7312 stat-time: Adapt for windows-stat-timespec.
* lib/stat-time.h (get_stat_birthtime) [_GL_WINDOWS_STAT_TIMESPEC]: Use
entire st_ctim field.
2017-05-14 17:38:22 +02:00
Jim Meyering 8e2bc0b51c 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.
2017-05-13 18:18:22 -07:00
Bruno Haible 47727ffa41 Use symbolic values for _WIN32_WINNT.
* lib/ftruncate.c (_WIN32_WINNT): Use symbolic value _WIN32_WINNT_WIN2K.
* lib/sethostname.c (_WIN32_WINNT): Likewise.
2017-05-13 16:16:05 +02:00
Bruno Haible 4ecbdc8220 year2038: New module.
* m4/year2038.m4: New file.
* modules/year2038: New file.
* doc/year2038.texi: New file.
* doc/gnulib.texi: Include it.
2017-05-13 16:16:05 +02:00
Bruno Haible 6327c7d86b largefile: Simplify.
* m4/sys_stat_h.m4 (gl_HEADER_SYS_STAT_H): Remove unused definition
of _GL_WINDOWS_64_BIT_ST_SIZE.
2017-05-13 16:16:04 +02:00
Bruno Haible 7a06674599 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.
2017-05-13 03:03:07 +02:00
Bruno Haible 63e26828e0 truncate-tests: New module.
* tests/test-truncate.c: New file.
* modules/truncate-tests: New file.
2017-05-13 02:55:24 +02:00
Bruno Haible f4d71054e7 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.
2017-05-13 02:54:37 +02:00
Bruno Haible 7d2f35f7f9 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.
2017-05-13 02:51:54 +02:00
Bruno Haible 44fe2082cf 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.
2017-05-13 02:46:43 +02:00
Bruno Haible 532f7f1eb7 fstat: Fix module dependency conditions.
* modules/fstat (Depends-on): Fix typo.
2017-05-13 02:39:00 +02:00
Bruno Haible 3a447f5959 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.
2017-05-13 02:36:19 +02:00
Bruno Haible 4557f862d2 stat: Complete removal of REPLACE_FUNC_STAT_DIR code.
* lib/stat.c: Remove all REPLACE_FUNC_STAT_DIR code.
2017-05-13 02:32:24 +02:00
Paul Eggert 19fb4184b0 getopt-posix: port to mingw
* lib/getopt.c (flockfile, funlockfile): Define on mingw.
Problem reported by Daniel P. Berrage in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-05/msg00086.html
2017-05-11 17:59:49 -07:00
Bruno Haible 055746f501 gettimeofday: Increase precision on mingw.
* m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY): Require AC_CANONICAL_HOST.
Set REPLACE_GETTIMEOFDAY to 1 on mingw.
* lib/gettimeofday.c (gettimeofday): On native Windows, use the
GetSystemTimePreciseAsFileTime based implementation always.
* doc/posix-functions/gettimeofday.texi: Mention precision problem on
mingw.
2017-05-11 21:39:06 +02:00
Bruno Haible 8898223d74 poll: Fix confusion between SOCKETs and FDs on native Windows.
Fix proposed by Daniel P. Berrange <berrange@redhat.com>.

* lib/poll.c [WINDOWS_NATIVE]: Undefine select.
2017-05-11 16:35:54 +02:00