]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agosys_ioctl: Simplify.
Bruno Haible [Sun, 16 Aug 2020 09:00:36 +0000 (11:00 +0200)]
sys_ioctl: Simplify.

* m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H): Remove confusing use of
AC_INCLUDES_DEFAULT.

4 years agoFix quoting of AC_LANG_SOURCE arguments.
Bruno Haible [Sun, 16 Aug 2020 06:37:39 +0000 (08:37 +0200)]
Fix quoting of AC_LANG_SOURCE arguments.

* m4/printf.m4 (gl_PRINTF_ENOMEM): Fix an m4 quoting bug in the
GL_NOCRASH expansion.
* m4/locale-ar.m4 (gt_LOCALE_AR): Simplify m4 quoting.
* m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise.
* m4/locale-ja.m4 (gt_LOCALE_JA): Likewise.
* m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise.
* m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.

4 years agonstrftime: be more predictable about errno
Paul Eggert [Sat, 15 Aug 2020 23:05:35 +0000 (16:05 -0700)]
nstrftime: be more predictable about errno

This aligns nstrftime better with draft POSIX 202x strftime.
* lib/nstrftime.c: Include errno.h.
(width_add, __strftime_internal): Set errno on failure,
and preserve it on success.  Check for mktime_z failure.
* modules/nstrftime (Depends-on): Add errno.
* modules/nstrftime-tests (Depends-on): Add atoll, intprops.
* tests/test-nstrftime.c: Include intprops.h, limits.h.
(errno_test): New test function.
(main): Call it.

4 years agocanonicalize: Fix a problem of the autoconf test on MSVC/clang.
Bruno Haible [Sat, 15 Aug 2020 16:59:30 +0000 (18:59 +0200)]
canonicalize: Fix a problem of the autoconf test on MSVC/clang.

* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Remove undesired file
from dependency analysis first.

4 years agoDetermine asm output option and filename suffix for MSVC/clang.
Bruno Haible [Sat, 15 Aug 2020 16:39:06 +0000 (18:39 +0200)]
Determine asm output option and filename suffix for MSVC/clang.

* m4/asm-underscore.m4 (gl_C_ASM): Distinguish clang from cl and
clang-cl.

4 years agodoc: Update for MSVC/clang.
Bruno Haible [Sat, 15 Aug 2020 15:52:24 +0000 (17:52 +0200)]
doc: Update for MSVC/clang.

* doc/*-functions/*printf.texi: Mention that MSVC/clang has two bugs
that MSVC 14 does not have.

4 years agoRevert autoupdate's revert.
Bruno Haible [Sat, 15 Aug 2020 15:54:45 +0000 (17:54 +0200)]
Revert autoupdate's revert.

* config/srclist.txt: Mark mktime.c as needing sync with glibc.

4 years agoautoupdate
Karl Berry [Sat, 15 Aug 2020 15:37:14 +0000 (08:37 -0700)]
autoupdate

4 years agofrexpl: Fix configuration test result on MSVC.
Bruno Haible [Sat, 15 Aug 2020 15:23:02 +0000 (17:23 +0200)]
frexpl: Fix configuration test result on MSVC.

* m4/frexpl.m4 (gl_FUNC_FREXPL_WORKS): Avoid a division by a constant
zero.

4 years agoSupport compiling without -loldnames on native Windows.
Bruno Haible [Sat, 15 Aug 2020 14:54:17 +0000 (16:54 +0200)]
Support compiling without -loldnames on native Windows.

* m4/gnulib-common.m4 (GL_MDA_DEFINES, _GL_MDA_DEFINES): New macros.
* m4/chown.m4 (AC_FUNC_CHOWN): In the test programs, use GL_MDA_DEFINES.
(gl_FUNC_CHOWN, gl_FUNC_CHOWN_FOLLOWS_SYMLINK): Likewise.
* m4/dup.m4 (gl_FUNC_DUP): Likewise.
* m4/dup2.m4 (gl_FUNC_DUP2): Likewise.
* m4/fchdir.m4 (gl_FUNC_FCHDIR): Likewise.
* m4/fchmodat.m4 (gl_FUNC_FCHMODAT): Likewise.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG): Likewise.
* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Likewise.
* m4/fcntl.m4 (gl_FUNC_FCNTL): Likewise.
* m4/fdopen.m4 (gl_FUNC_FDOPEN): Likewise.
* m4/fdopendir.m4 (gl_FUNC_FDOPENDIR): Likewise.
* m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): Likewise.
* m4/fopen.m4 (gl_FUNC_FOPEN_GNU): Likewise.
* m4/freopen.m4 (gl_FUNC_FREOPEN): Likewise.
* m4/futimens.m4 (gl_FUNC_FUTIMENS): Likewise.
* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Likewise.
* m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.
* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL, gl_FUNC_GETCWD_SIGNATURE):
Likewise.
* m4/getdtablesize.m4 (gl_FUNC_GETDTABLESIZE): Likewise.
* m4/linkat.m4 (gl_FUNC_LINKAT): Likewise.
* m4/lseek.m4 (gl_FUNC_LSEEK): Likewise.
* m4/mkdir.m4 (gl_FUNC_MKDIR): Likewise.
* m4/mkstemp.m4 (gl_FUNC_MKSTEMP): Likewise.
* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Likewise.
* m4/open-slash.m4 (gl_OPEN_TRAILING_SLASH_BUG): Likewise.
* m4/poll.m4 (gl_FUNC_POLL): Likewise.
* m4/posix_spawn.m4 (gl_POSIX_SPAWN_WORKS): Likewise.
* m4/pread.m4 (gl_FUNC_PREAD): Likewise.
* m4/pselect.m4 (gl_FUNC_PSELECT): Likewise.
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Likewise.
* m4/ptsname_r.m4 (gl_PREREQ_PTSNAME_R): Likewise.
* m4/putenv.m4 (gl_FUNC_PUTENV): Likewise.
* m4/pwrite.m4 (gl_FUNC_PWRITE): Likewise.
* m4/rename.m4 (gl_FUNC_RENAME): Likewise.
* m4/rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Likewise.
* m4/rmdir.m4 (gl_FUNC_RMDIR): Likewise.
* m4/select.m4 (gl_FUNC_SELECT): Likewise.
* m4/setenv.m4 (gl_FUNC_UNSETENV): Likewise.
* m4/strncat.m4 (gl_FUNC_STRNCAT): Likewise.
* m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Likewise.
* m4/unlink-busy.m4 (gl_FUNC_UNLINK_BUSY_TEXT): Likewise.
* m4/unlink.m4 (gl_FUNC_UNLINK): Likewise.
* m4/utimens.m4 (gl_UTIMENS): Likewise.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise.
* m4/utimes.m4 (gl_FUNC_UTIMES): Likewise.
* m4/canonicalize.m4 (gl_CANONICALIZE_LGPL): On native Windows, don't
test for getcwd.
* m4/utime.m4 (gl_FUNC_UTIME): On native Windows, don't test for utime.
* m4/wcsdup.m4 (gl_FUNC_WCSDUP): To test for wcsdup, use a test program
with GL_MDA_DEFINES.
* lib/c++defs.h (_GL_CXXALIAS_MDA): New macro.
* lib/fcntl.in.h (creat, open):  On native Windows, use the underscore-
prefixed symbol.
* lib/search.in.h (lfind, lsearch): Likewise.
* lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam):
Likewise.
* lib/stdlib.in.h (ecvt, fcvt, gcvt, mktemp, putenv): Likewise.
* lib/string.in.h (memccpy, strdup): Likewise.
* lib/sys_stat.in.h (chmod, umask): Likewise.
* lib/time.in.h (tzset): Likewise.
* lib/unistd.in.h (access, chdir, close, dup, dup2, execl, execle,
execlp, execv, execve, execvp, execvpe, getcwd, getpid, isatty, lseek,
read, rmdir, swab, unlink, write): Likewise.
* lib/utime.in.h (utime): Likewise.
* lib/wchar.in.h (wcsdup): Likewise.
* lib/math.in.h (j0, j1, jn, y0, y1, yn):  Likewise.
(isfinite, isinf, isnan, signbit): On native Windows, don't define as an
rpl_-prefixed macro.
* lib/canonicalize-lgpl.c (__getcwd): On native Windows, use _getcwd.
* lib/close.c (close_nothrow): On native Windows, use _close.
* lib/creat.c (orig_creat): On native Windows, use _creat.
* lib/dup.c (dup_nothrow): On native Windows, use _dup.
* lib/dup2.c (dup2_nothrow): Use _dup2.
* lib/fdopen.c (fdopen_nothrow): On native Windows, use _fdopen.
* lib/getcwd-lgpl.c: On native Windows, use _getcwd.
* lib/getcwd.c (getcwd_nothrow): Use _getcwd also on mingw.
* lib/open.c (orig_open): On native Windows, use _open.
* lib/read.c (read_nothrow): Use _read.
* lib/rmdir.c: On native Windows, use _rmdir.
* lib/unlink.c: On native Windows, use _unlink.
* lib/write.c (write_nothrow): Use _write.
* lib/sys_select.in.h (close): With clang, don't attach a warning on an
undefined symbol.
* lib/sys_socket.in.h (close): Likewise.
* lib/sys_time.in.h (close): Likewise.
* tests/test-spawn-pipe-child.c: On native Windows, use _fdopen.

4 years agoFix "unknown pragma ignored" warnings with clang on native Windows.
Bruno Haible [Sat, 15 Aug 2020 08:27:30 +0000 (10:27 +0200)]
Fix "unknown pragma ignored" warnings with clang on native Windows.

* lib/cbrt.c: Don't use '#pragma fenv_access (off)' with clang.
* lib/cbrtf.c: Likewise.
* lib/ceil.c: Likewise.
* lib/floor.c: Likewise.
* lib/fma.c: Likewise.
* lib/fmod.c: Likewise.
* lib/rint.c: Likewise.
* lib/round.c: Likewise.
* lib/trunc.c: Likewise.
* tests/test-ceil2.c: Likewise.
* tests/test-ceilf2.c: Likewise.
* tests/test-floor2.c: Likewise.
* tests/test-floorf2.c: Likewise.
* tests/test-trunc2.c: Likewise.
* tests/test-truncf2.c: Likewise.
* m4/round.m4 (gl_FUNC_ROUND): Likewise.
* m4/roundf.m4 (gl_FUNC_ROUNDF): Likewise.

4 years agoFix compilation errors in C++ mode with clang on native Windows.
Bruno Haible [Sat, 15 Aug 2020 07:55:18 +0000 (09:55 +0200)]
Fix compilation errors in C++ mode with clang on native Windows.

* lib/pthread.in.h (pthread_*): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.
* lib/sched.in.h (sched_yield): Likewise.

4 years agostdnoreturn: Work around problem with MSVC/clang.
Bruno Haible [Sat, 15 Aug 2020 00:15:26 +0000 (02:15 +0200)]
stdnoreturn: Work around problem with MSVC/clang.

* m4/stdnoreturn.m4 (gl_STDNORETURN_H): On native Windows, include some
system header after <stdnoreturn.h>.
* doc/posix-headers/stdnoreturn.texi: Mention the issue.

4 years agoutime-h: Generate an utime.h file always.
Bruno Haible [Fri, 14 Aug 2020 22:14:14 +0000 (00:14 +0200)]
utime-h: Generate an utime.h file always.

* modules/utime-h (Makefile.am): Generate utime.h always.
* m4/utime_h.m4 (gl_UTIME_H): Don't set UTIME_H. Don't define
GL_GENERATE_UTIME_H.

4 years agomktime, mktime-internal: Remove obsolete code.
Bruno Haible [Fri, 14 Aug 2020 19:13:16 +0000 (21:13 +0200)]
mktime, mktime-internal: Remove obsolete code.

* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Don't #undef putenv.

4 years agogetcwd: Remove obsolete code.
Bruno Haible [Fri, 14 Aug 2020 18:48:09 +0000 (20:48 +0200)]
getcwd: Remove obsolete code.

* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Don't #undef mkdir.
* m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise.

4 years agotzset: Assume the function exists.
Bruno Haible [Fri, 14 Aug 2020 18:06:32 +0000 (20:06 +0200)]
tzset: Assume the function exists.

* lib/time.in.h (tzset): Assume HAVE_TZSET is 1.
* lib/tzset.c: Define rpl_tzset, not tzset. Assume HAVE_TZSET is 1.
* modules/tzset (configure.ac): Don't test HAVE_TZSET.
* m4/tzset.m4 (gl_FUNC_TZSET): Don't test for tzset. Don't set
HAVE_TZSET.
* m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Don't initialize HAVE_TZSET.
* modules/time (Makefile.am): Don't substitute HAVE_TZSET.

4 years agonstrftime: Assume tzset exists.
Bruno Haible [Fri, 14 Aug 2020 18:03:33 +0000 (20:03 +0200)]
nstrftime: Assume tzset exists.

* lib/nstrftime.c (HAVE_TZSET): Remove macro.
(__strftime_internal): Test my_strftime, not HAVE_TZSET.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't test for tzset.

4 years agomktime, mktime-internal: Assume tzset exists.
Bruno Haible [Fri, 14 Aug 2020 18:02:07 +0000 (20:02 +0200)]
mktime, mktime-internal: Assume tzset exists.

* lib/mktime.c (my_tzset): Assume HAVE_TZSET is 1.
* m4/mktime.m4 (gl_FUNC_MKTIME_WORKS): Don't test for tzset.

4 years agostrdup: Assume the function exists.
Bruno Haible [Fri, 14 Aug 2020 17:51:56 +0000 (19:51 +0200)]
strdup: Assume the function exists.

* m4/strdup.m4 (gl_FUNC_STRDUP, gl_FUNC_STRDUP_POSIX): Don't test
whether strdup exists.
* modules/strdup (Files): Remove lib/strdup.c.
(configure.ac): Don't compile strdup.c.
* modules/strdup-posix (Depends-on, configure.ac): Don't test
ac_cv_func_strdup.
* doc/posix-functions/strdup.texi: Update.
* lib/unistr/u8-strdup.c: Assume HAVE_STRDUP is 1.
* modules/unistr/u8-strdup (Files): Remove lib/unistr/u-strdup.h.
(Depends-on): Remove unistr/u8-strlen.

4 years agosys_random: Work around an uClibc bug.
Bruno Haible [Thu, 13 Aug 2020 15:49:35 +0000 (17:49 +0200)]
sys_random: Work around an uClibc bug.

Reported by akater <nuclearspace@gmail.com>
via Stefan Kangas <stefan@marxist.se>
in <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42236>.

* lib/sys_random.in.h: On uClibc, include <stddef.h> first.
* m4/sys_random_h.m4 (gl_HEADER_SYS_RANDOM): Update comment.
* m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise.
* doc/glibc-headers/sys_random.texi: Mention the uClibc bug.

4 years agoAvoid implicit conversion from 'unsigned int' to 'int' in initializers.
Bruno Haible [Thu, 13 Aug 2020 00:06:09 +0000 (02:06 +0200)]
Avoid implicit conversion from 'unsigned int' to 'int' in initializers.

Reported by Florian Weimer in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00086.html>.

* lib/gen-uni-tables.c (output_predicate): Change the element type of
the level3 array to 'unsigned int'.
* lib/unictype/bitmap.h (bitmap_lookup): Access an 'unsigned int'.
* lib/unictype/categ_*.h: Regenerated.
* lib/unictype/ctype_*.h: Regenerated.
* lib/unictype/pr_*.h: Regenerated.
* lib/unictype/sy_*.h: Regenerated.
* lib/unicase/cased.h: Regenerated.
* lib/unicase/ignorable.h: Regenerated.

4 years agostdint: port intptr_t to more-recent MinGW
Paul Eggert [Wed, 12 Aug 2020 18:27:48 +0000 (11:27 -0700)]
stdint: port intptr_t to more-recent MinGW

Problem reported by Eli Zaretskii in <https://bugs.gnu.org/36597#106>.
* lib/stdint.in.h (intptr_t, uintptr_t): Do not define on MinGW,
even if _INTPTR_T_DEFINED and _UINTPTR_T_DEFINED are not defined.
Apparently those two macros were removed in mingwrt-3.22
dated 2016-07-14.

4 years agothread-optim: Export function-like macros only.
Bruno Haible [Wed, 12 Aug 2020 17:59:47 +0000 (19:59 +0200)]
thread-optim: Export function-like macros only.

Suggested by Paul Eggert.

* lib/thread-optim.h (gl_multithreaded): New macro.
(IF_MT_DECL, IF_MT): Remove macros.
* doc/multithread.texi (Multithreading Optimizations): Add a small
example.
* lib/fatal-signal.c: Update all uses.
* lib/clean-temp.c: Likewise.
* lib/localename.c: Likewise.
* modules/localename (Depends-on): Add stdbool.

4 years agoRevert autoupdate's revert.
Bruno Haible [Wed, 12 Aug 2020 18:23:00 +0000 (20:23 +0200)]
Revert autoupdate's revert.

* config/srclist.txt: Mark regex.h as needing sync with glibc.

4 years agoautoupdate
Karl Berry [Wed, 12 Aug 2020 17:12:13 +0000 (10:12 -0700)]
autoupdate

4 years agothread-optim: Fix a compiler warning.
Bruno Haible [Wed, 12 Aug 2020 00:42:32 +0000 (02:42 +0200)]
thread-optim: Fix a compiler warning.

* lib/thread-optim.h (IF_MT_DECL): Define differently.

4 years agoUse __restrict also on clang.
Bruno Haible [Wed, 12 Aug 2020 00:24:04 +0000 (02:24 +0200)]
Use __restrict also on clang.

* lib/cdefs.h (__restrict): Don't define as a macro on clang.
(__restrict_arr): On clang, define like on GCC.
* lib/regex.h (_Restrict_): Use '__restrict' also on clang.
(_Restrict_arr_): Use _Restrict_ also on clang.
* lib/spawn.in.h (_Restrict_): Use '__restrict' also on clang.
(_Restrict_arr_): Use _Restrict_ also on clang.

4 years agoUse flexible array syntax also on clang.
Bruno Haible [Tue, 11 Aug 2020 19:59:15 +0000 (21:59 +0200)]
Use flexible array syntax also on clang.

* lib/cdefs.h (__flexarr, __glibc_c99_flexarr_available): For clang,
define like for GCC 3.

4 years agofcntl: On native Windows, use _setmode, not setmode.
Bruno Haible [Tue, 11 Aug 2020 19:25:45 +0000 (21:25 +0200)]
fcntl: On native Windows, use _setmode, not setmode.

* lib/fcntl.c (dupfd): Use _setmode, not setmode.
* lib/binary-io.h: Update comment.
* tests/test-cloexec.c: Call set_binary_mode, not setmode.
* tests/test-dup2.c: Likewise.
* tests/test-dup-safer.c: Likewise.
* tests/test-fcntl.c: Likewise.

4 years agoexecute, spawn-pipe: Use _spawnvpe, not spawnvpe.
Bruno Haible [Tue, 11 Aug 2020 18:55:52 +0000 (20:55 +0200)]
execute, spawn-pipe: Use _spawnvpe, not spawnvpe.

* lib/execute.c (execute): Use _spawnvpe, not spawnvpe.
* lib/spawn-pipe.c (create_pipe): Likewise.
* tests/test-nonblocking-pipe-main.c (main): Likewise.
* tests/test-nonblocking-socket-main.c (main): Likewise.
* lib/wait-process.c: Update comment.
* doc/posix-functions/fork.texi: Update.

4 years agoasyncsafe-spin: Use GCC built-ins also on clang.
Bruno Haible [Tue, 11 Aug 2020 17:11:41 +0000 (19:11 +0200)]
asyncsafe-spin: Use GCC built-ins also on clang.

* lib/asyncsafe-spin.c (asyncsafe_spin_init, do_lock, do_unlock): Use
the newer GCC built-ins also on clang.

4 years agoUse expression statements also on clang.
Bruno Haible [Tue, 11 Aug 2020 16:36:25 +0000 (18:36 +0200)]
Use expression statements also on clang.

* lib/cdefs.h (__extension__): Don't define to empty on clang.
* lib/obstack.h (__extension__): Likewise.
(obstack_object_size, obstack_room, obstack_make_room, obstack_empty_p,
obstack_grow, obstack_grow0, obstack_1grow, obstack_ptr_grow,
obstack_int_grow, obstack_ptr_grow_fast, obstack_int_grow_fast,
obstack_blank, obstack_alloc, obstack_copy, obstack_copy0,
obstack_finish, obstack_free): Enable as optimized macros also on clang.
* lib/fpucw.h (fpucw_t etc.): Enable the definitions also on clang.

4 years agoUse many __attribute__s with clang.
Bruno Haible [Mon, 10 Aug 2020 23:53:13 +0000 (01:53 +0200)]
Use many __attribute__s with clang.

* m4/gnulib-common.m4 (_Noreturn): Use __attribute__ __noreturn__ also
on clang.
* lib/cdefs.h (__glibc_clang_has_attribute, __glibc_clang_has_builtin):
New macros.
(__THROW, __THROWNL, __NTH, __NTHNL): Use __attribute__ __nothrow__ also
on clang.
(__warndecl, __warnattr, __errordecl): Use __attribute__ __diagnose_if__
also on older clang versions.
(__attribute__): Don't define to empty on clang.
(__attribute_malloc__): Use __attribute__ __malloc__ also on clang.
(__attribute_pure__): Use __attribute__ __pure__ also on clang.
(__attribute_const__): Use __attribute__ __const__ also on clang.
(__attribute_used__): Use __attribute__ __used__ also on clang.
(__attribute_noinline__): Use __attribute__ __noinline__ also on clang.
(__attribute_deprecated__): Use __attribute__ __deprecated__ also on
clang.
(__attribute_format_arg__): Use __attribute__ __format_arg__ also on
clang.
(__attribute_format_strfmon__): Use __attribute__ __format__ __strfmon__
also on clang.
(__nonnull): Use __attribute__ __nonnull__ also on clang.
(__attribute_warn_unused_result__): Use __attribute__
__warn_unused_result__ also on clang.
(__always_inline): Use __attribute__ __always_inline__ also on clang.
(__attribute_artificial__): Use __attribute__ __artificial__ also on
clang >= 7.
(__glibc_unlikely, __glibc_likely): Use __builtin_expect also on older
clang versions.
(_Noreturn): Don't redefine on clang >= 3.5.
* lib/arg-nonnull.h (_GL_ARG_NONNULL): Use __attribute__ __nonnull__
also on clang.
* lib/dirent.in.h (_GL_ATTRIBUTE_PURE): Use __attribute__ __pure__ also
on clang.
* lib/stdlib.in.h (_GL_ATTRIBUTE_PURE): Likewise.
* lib/string.in.h (_GL_ATTRIBUTE_PURE): Likewise.
* lib/wchar.in.h (_GL_ATTRIBUTE_PURE): Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_FORMAT): Use __attribute__ __format__
also on clang.
* lib/monetary.in.h (_GL_ATTRIBUTE_FORMAT): Likewise.
* lib/textstyle.in.h (ostream_printf, ostream_vprintf): Likewise.
* lib/unitypes.in.h (_UC_ATTRIBUTE_CONST): Use __attribute__ __const__
also on clang.
(_UC_ATTRIBUTE_PURE): Use __attribute__ __pure__ also on clang.
* lib/noreturn.h (_GL_NORETURN_FUNC, _GL_NORETURN_FUNCPTR): Use
__attribute__ __noreturn__ also on clang.
* lib/obstack.h (__attribute_noreturn__): Likewise.
* lib/file-set.h (record_file): Use __attribute__ __nonnull__ also on
clang.
* lib/argp-help.c (hol_entry_long_iterate): Use __attribute__
always_inline also on clang.
* tests/test-printf-posix.c (func1, func2, func3, func4): Test also on
clang.

4 years agoc-ldtoastr tests: Fix test failure.
Bruno Haible [Mon, 10 Aug 2020 17:40:07 +0000 (19:40 +0200)]
c-ldtoastr tests: Fix test failure.

* tests/test-c-ldtoastr.c (main): Support platforms where 'long double'
is longer than 'double'.

4 years agoRevert autoupdate's revert.
Bruno Haible [Mon, 10 Aug 2020 17:44:24 +0000 (19:44 +0200)]
Revert autoupdate's revert.

* config/srclist.txt: Mark intprops.h as needing sync with glibc.

4 years agoautoupdate
Karl Berry [Mon, 10 Aug 2020 15:16:37 +0000 (08:16 -0700)]
autoupdate

4 years agostring: Fix build error in C++ mode with clang (regression from today).
Bruno Haible [Mon, 10 Aug 2020 01:17:06 +0000 (03:17 +0200)]
string: Fix build error in C++ mode with clang (regression from today).

* lib/warn-on-use.h (_GL_WARN_ON_USE_CXX): Expect two rettype
parameters, one for GCC, one for clang.
* lib/c++defs.h (_GL_CXXALIASWARN1_2): Update.
* lib/string.in.h (strchr, strpbrk, strrchr): For clang, pass 'char *'
as return type.

4 years agoftruncate: Use _chsize, not chsize.
Bruno Haible [Sun, 9 Aug 2020 20:59:26 +0000 (22:59 +0200)]
ftruncate: Use _chsize, not chsize.

* m4/ftruncate.m4 (gl_PREREQ_FTRUNCATE): Test for _chsize, not chsize.
* lib/ftruncate.c: Test HAVE__CHSIZE.
(chsize_nothrow): Use _chsize, not chsize.

4 years agoSilence warnings from clang 10 with -Wimplicit-fallthrough.
Bruno Haible [Sun, 9 Aug 2020 18:09:36 +0000 (20:09 +0200)]
Silence warnings from clang 10 with -Wimplicit-fallthrough.

* lib/dfa.c (FALLTHROUGH): Use __attribute__ __fallthrough__ also on
clang >= 10.
* lib/fnmatch.c (FALLTHROUGH): Likewise.
* lib/fts.c (FALLTHROUGH): Likewise.
* tests/macros.h (FALLTHROUGH): Likewise.
* lib/regex_internal.h (FALLTHROUGH): Likewise.
* config/srclist.txt: Mark it as needing sync with glibc.

4 years agostdbool tests: Enable the stricter tests also on clang.
Bruno Haible [Sun, 9 Aug 2020 16:55:26 +0000 (18:55 +0200)]
stdbool tests: Enable the stricter tests also on clang.

* tests/test-stdbool.c (ADDRESS_CHECK_OKAY): Define also on clang.
(e): Enable the address-to-bool conversion test also on clang.

4 years agocount-one-bits: Use __builtin_popcount{,l,ll} on clang.
Bruno Haible [Sun, 9 Aug 2020 16:33:17 +0000 (18:33 +0200)]
count-one-bits: Use __builtin_popcount{,l,ll} on clang.

* lib/count-one-bits.h (COUNT_ONE_BITS): Use the GCC built-in.

4 years agoUse attribute __aligned__ with clang.
Bruno Haible [Sun, 9 Aug 2020 16:12:36 +0000 (18:12 +0200)]
Use attribute __aligned__ with clang.

* lib/stdalign.in.h (_Alignas): Treat clang like GCC.
* lib/stddef.in.h (_GL_STDDEF_ALIGNAS): Likewise.

4 years agoUse __alignof__ with clang.
Bruno Haible [Sun, 9 Aug 2020 13:58:10 +0000 (15:58 +0200)]
Use __alignof__ with clang.

* m4/stddef_h.m4 (gl_STDDEF_H): Test the alignment of max_align_t also
on clang.
* lib/alignof.h (alignof_type): Use __alignof__ also on clang.
* lib/stdalign.in.h (_Alignof): Don't activate the GCC workaround on
clang.
* lib/malloca.h (sa_alignof): Use __alignof__ also on clang.
* lib/bitset/list.c (lbitset_elt_alloc): Use __alignof__ also on clang.
* lib/bitset/table.c (tbitset_elt_alloc): Likewise.
* tests/test-stddef.c: Very the behaviour of __alignof__ also on clang.

4 years agoignore-value: Simplify on clang.
Bruno Haible [Sun, 9 Aug 2020 13:07:28 +0000 (15:07 +0200)]
ignore-value: Simplify on clang.

* lib/ignore-value.h (ignore_value): With clang, no need to use the GCC
workaround.

4 years agoUse __typeof__ with clang.
Bruno Haible [Sun, 9 Aug 2020 13:01:23 +0000 (15:01 +0200)]
Use __typeof__ with clang.

* m4/stdint.m4 (gl_STDINT_H): Check for SIZE_MAX also on
"clang -std=gnu99".
* lib/intprops.h (_GL_HAVE___TYPEOF__): Define to 1 also on clang.
* tests/test-stdint.c (verify_same_types): Enable the check also on
clang.

4 years agoAdd ability to emit user-defined warnings and errors with clang.
Bruno Haible [Sun, 9 Aug 2020 12:51:56 +0000 (14:51 +0200)]
Add ability to emit user-defined warnings and errors with clang.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define _GL_ATTRIBUTE_ERROR,
_GL_ATTRIBUTE_WARNING using an attribute for clang.
* lib/warn-on-use.h (_GL_WARN_ON_USE, _GL_WARN_ON_USE_ATTRIBUTE,
_GL_WARN_ON_USE_CXX): Define using an attribute for clang.
* lib/cdefs.h (__warndecl, __warnattr, __errordecl): Define using an
attribute for clang.

4 years agointprops: Fix typo in comment.
Bruno Haible [Sun, 9 Aug 2020 11:28:36 +0000 (13:28 +0200)]
intprops: Fix typo in comment.

* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P): Fix typo in comment.

4 years agoUse __builtin_signbit* with clang.
Bruno Haible [Sun, 9 Aug 2020 10:36:37 +0000 (12:36 +0200)]
Use __builtin_signbit* with clang.

* lib/math.in.h (signbit): Use __builtin_signbit{,f,l} also on clang.
* m4/signbit.m4 (gl_SIGNBIT): Use __builtin_signbit{,f,l} also on clang.
Set REPLACE_SIGNBIT_USING_BUILTINS, not REPLACE_SIGNBIT_USING_GCC.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize
REPLACE_SIGNBIT_USING_BUILTINS, not REPLACE_SIGNBIT_USING_GCC.
* modules/math (Makefile.am): Substitute REPLACE_SIGNBIT_USING_BUILTINS,
not REPLACE_SIGNBIT_USING_GCC.

4 years agoUse __builtin_isnan with clang.
Bruno Haible [Sun, 9 Aug 2020 10:09:17 +0000 (12:09 +0200)]
Use __builtin_isnan with clang.

* lib/isnanf-nolibm.h (isnanf): Use the GCC built-in __builtin_isnan,
not __builtin_isnanf. Also on clang.
* m4/isnanf.m4 (gl_HAVE_ISNANF_NO_LIBM, gl_ISNANF_WORKS): Use the GCC
built-in __builtin_isnan, not __builtin_isnanf. Also on clang.
* lib/isnand-nolibm.h (isnand): With clang, use the GCC built-in.
* m4/isnand.m4 (gl_HAVE_ISNAND_IN_LIBM): With clang, use the GCC
built-in.
* lib/isnanl-nolibm.h (isnanf): Use the GCC built-in __builtin_isnan,
not __builtin_isnanl. Also on clang.
* m4/isnanl.m4 (gl_HAVE_ISNANL_NO_LIBM, gl_FUNC_ISNANL_WORKS): Use the
GCC built-in __builtin_isnan, not __builtin_isnanl. Also on clang.
* lib/math.in.h (__has_builtin): Remove macro.
(isnanf, gl_isnan_f): Use the GCC built-in __builtin_isnan, not
__builtin_isnanf. Also on clang.
(isnand, gl_isnan_d): With clang, use the GCC built-in.
(isnanl, gl_isnan_l): Use the GCC built-in __builtin_isnan, not
__builtin_isnanl. Also on clang.
(isnan): Use the GCC built-in __builtin_isnan in all three cases. Also
on clang.

4 years agothread-optim: Fix logic error.
Bruno Haible [Sun, 9 Aug 2020 09:31:48 +0000 (11:31 +0200)]
thread-optim: Fix logic error.

Reported by Paul Eggert.

* lib/thread-optim.h (IF_MT): Fix logic error.

4 years agolocalename: Use module 'thread-optim'.
Bruno Haible [Sat, 8 Aug 2020 20:11:50 +0000 (22:11 +0200)]
localename: Use module 'thread-optim'.

* lib/localename.c: Include thread-optim.h.
(struniq): Use IF_MT macro.
* modules/localename (Depends-on): Add thread-optim.

4 years agoclean-temp: Use module 'thread-optim'.
Bruno Haible [Sat, 8 Aug 2020 20:09:09 +0000 (22:09 +0200)]
clean-temp: Use module 'thread-optim'.

* lib/clean-temp.c: Include thread-optim.h.
(register_temporary_file, unregister_temporary_file, create_temp_dir,
register_temp_file, unregister_temp_file, register_temp_subdir,
unregister_temp_subdir, cleanup_temp_dir_contents, register_fd,
close_temp, fclose_variant_temp): Use IF_MT macro.
* modules/clean-temp (Depends-on): Add thread-optim.

4 years agofatal-signal: Use module 'thread-optim'.
Bruno Haible [Sat, 8 Aug 2020 20:05:25 +0000 (22:05 +0200)]
fatal-signal: Use module 'thread-optim'.

* lib/fatal-signal.c: Include thread-optim.h.
(at_fatal_signal, block_fatal_signals, unblock_fatal_signals): Use IF_MT
macro.
* modules/fatal-signal (Depends-on): Add thread-optim.

4 years agoNew module 'thread-optim'.
Bruno Haible [Sat, 8 Aug 2020 17:47:28 +0000 (19:47 +0200)]
New module 'thread-optim'.

* lib/thread-optim.h: New file.
* modules/thread-optim: New file.
* doc/multithread.texi (Multithreading Optimizations): New section.

4 years agodoc: more updates for glibc 2.32
Paul Eggert [Fri, 7 Aug 2020 22:26:27 +0000 (15:26 -0700)]
doc: more updates for glibc 2.32

* doc/glibc-functions/lchmod.texi, doc/posix-functions/faccessat.texi:
* doc/posix-functions/fchmodat.texi: Update.

4 years agodoc: Update for glibc 2.32.
Bruno Haible [Fri, 7 Aug 2020 21:02:21 +0000 (23:02 +0200)]
doc: Update for glibc 2.32.

* doc/glibc-functions/__libc_single_threaded.texi: New file.
* doc/glibc-functions/pthread_attr_getsigmask_np.texi: New file.
* doc/glibc-functions/pthread_attr_setsigmask_np.texi: New file.
* doc/glibc-functions/sigabbrev_np.texi: New file.
* doc/glibc-functions/sigdescr_np.texi: New file.
* doc/glibc-functions/strerrordesc_np.texi: New file.
* doc/glibc-functions/strerrorname_np.texi: New file.
* doc/gnulib.texi: Include them.
(Glibc sys/single_threaded.h): New section.
* doc/pastposix-functions/h_errno.texi: Update.
* doc/posix-functions/*.texi: Likewise.
* doc/glibc-functions/*.texi: Likewise.

4 years agoalloca: No need to compile alloca.c with clang.
Bruno Haible [Fri, 7 Aug 2020 12:55:22 +0000 (14:55 +0200)]
alloca: No need to compile alloca.c with clang.

* lib/alloca.c: Skip all code with clang.

4 years agoUse __builtin_alloca with clang.
Bruno Haible [Fri, 7 Aug 2020 11:19:48 +0000 (13:19 +0200)]
Use __builtin_alloca with clang.

* lib/alloca.in.h (alloca): Define as __builtin_alloca on clang.

4 years agoUse __builtin_assume with clang.
Bruno Haible [Fri, 7 Aug 2020 00:12:09 +0000 (02:12 +0200)]
Use __builtin_assume with clang.

* lib/verify.h (_GL_HAS_BUILTIN_ASSUME): New macro.
(assume): Use __builtin_assume when available.

4 years agolibgmp: add <gmp/gmp.h> support
Paul Eggert [Thu, 6 Aug 2020 21:53:08 +0000 (14:53 -0700)]
libgmp: add <gmp/gmp.h> support

* m4/libgmp.m4 (gl_LIBGMP):
* modules/libgmp (configure.ac, Makefile.am):
Support platforms requiring ‘#include <gmp/gmp.h>’ instead of
‘#include <gmp.h>’.

4 years agoConsider that clang defines __OPTIMIZE__ like GCC does.
Bruno Haible [Thu, 6 Aug 2020 18:55:13 +0000 (20:55 +0200)]
Consider that clang defines __OPTIMIZE__ like GCC does.

* lib/streq.h: Define the inline functions also on clang.
* lib/c-strcaseeq.h: Likewise.
* lib/c++defs.h (_GL_CXXALIASWARN_2, _GL_CXXALIASWARN1_2): Don't enable
the GCC workaround to clang.

4 years agosafe-alloc: Remove unused code.
Bruno Haible [Thu, 6 Aug 2020 18:41:33 +0000 (20:41 +0200)]
safe-alloc: Remove unused code.

* lib/safe-alloc.h (__GNUC_PREREQ): Remove macro.

4 years agoUse __builtin_expect with clang everywhere.
Bruno Haible [Thu, 6 Aug 2020 18:34:29 +0000 (20:34 +0200)]
Use __builtin_expect with clang everywhere.

* lib/cdefs.h (__glibc_unlikely, __glibc_likely): Use the GCC built-in
also on clang.

4 years agoUse __builtin_ctz{,l,ll} and __builtin_ffs{,l,ll} with clang everywhere.
Bruno Haible [Wed, 5 Aug 2020 17:57:21 +0000 (19:57 +0200)]
Use __builtin_ctz{,l,ll} and __builtin_ffs{,l,ll} with clang everywhere.

* lib/count-trailing-zeros.h (COUNT_TRAILING_ZEROS): Use the GCC
built-in also on clang.
* lib/ffs.c: With clang, use the GCC built-in, not <intrin.h>.
* lib/ffsl.h: Likewise. Assume GCC_BUILTIN is defined.

4 years agoUse __builtin_clz{,l,ll} with clang, also on Windows.
Bruno Haible [Wed, 5 Aug 2020 17:25:42 +0000 (19:25 +0200)]
Use __builtin_clz{,l,ll} with clang, also on Windows.

* lib/integer_length.c: With clang, use the GCC built-in, not
<intrin.h>.
* lib/integer_length_l.c: Likewise.
* lib/count-leading-zeros.h (COUNT_LEADING_ZEROS): Use the GCC built-in
also on clang.
* lib/vasnprintf.c (divide): Likewise.

4 years agoUpdate srclist.txt as per recent glibc changes
Paul Eggert [Wed, 5 Aug 2020 06:54:47 +0000 (23:54 -0700)]
Update srclist.txt as per recent glibc changes

* config/srclist.txt: Uncomment lines to reflect recent merges
from Gnulib to glibc.

4 years agoPrefer documented autoconf macro 'm4_if' over 'ifelse'.
Bruno Haible [Mon, 3 Aug 2020 23:52:48 +0000 (01:52 +0200)]
Prefer documented autoconf macro 'm4_if' over 'ifelse'.

* m4/progtest.m4 (AM_PATH_PROG_WITH_TEST): Use m4_if instead of ifelse.

4 years agointeger_length_ll: Optimize for MSVC in 64-bit mode.
Bruno Haible [Mon, 3 Aug 2020 23:17:36 +0000 (01:17 +0200)]
integer_length_ll: Optimize for MSVC in 64-bit mode.

* lib/integer_length_l.c (MSVC_BUILTIN): Define for MSVC in 64-bit mode.
(FUNC): On MSVC, use MSVC_BUILTIN if defined.

4 years agointeger_length_ll: Optimize for MSVC in 32-bit mode.
Bruno Haible [Mon, 3 Aug 2020 23:10:23 +0000 (01:10 +0200)]
integer_length_ll: Optimize for MSVC in 32-bit mode.

* lib/integer_length_l.c: Include <intrin.h>.
(integer_length): Define as inline function, like in
lib/integer_length.c.

4 years agointeger_length: Optimize for MSVC.
Bruno Haible [Mon, 3 Aug 2020 22:40:24 +0000 (00:40 +0200)]
integer_length: Optimize for MSVC.

* lib/integer_length.c: Include <intrin.h>.
(integer_length): With MSVC, use the _BitScanReverse built-in.

4 years agoffsll: Optimize for MSVC in 64-bit mode.
Bruno Haible [Mon, 3 Aug 2020 22:13:46 +0000 (00:13 +0200)]
ffsll: Optimize for MSVC in 64-bit mode.

* lib/ffsl.h (FUNC): On MSVC, use MSVC_BUILTIN if defined.
* lib/ffsll.c (MSVC_BUILTIN): Define for MSVC in 64-bit mode.
* lib/ffsl.c (MSVC_BUILTIN): Define for MSVC.

4 years agoffsll: Optimize for MSVC in 32-bit mode.
Bruno Haible [Mon, 3 Aug 2020 22:11:02 +0000 (00:11 +0200)]
ffsll: Optimize for MSVC in 32-bit mode.

* lib/ffsl.h: Include <intrin.h>.
(ffs): Define as inline function, like in lib/ffs.c.

4 years agoffs: Optimize for MSVC.
Bruno Haible [Mon, 3 Aug 2020 22:05:05 +0000 (00:05 +0200)]
ffs: Optimize for MSVC.

* lib/ffs.c: Include <intrin.h>.
(ffs): With MSVC, use the _BitScanForward built-in.

4 years agosigprocmask: Try to avoid breakage for people who use an Autoconf cache.
Bruno Haible [Mon, 3 Aug 2020 21:43:55 +0000 (23:43 +0200)]
sigprocmask: Try to avoid breakage for people who use an Autoconf cache.

* m4/signalblocking.m4 (gl_SIGNALBLOCKING): Change the name of the cache
variable.

4 years agofopen: Avoid undesired interactions with glibc headers.
Harald van Dijk [Mon, 3 Aug 2020 19:59:04 +0000 (21:59 +0200)]
fopen: Avoid undesired interactions with glibc headers.

* lib/fopen.c (_GL_ALREADY_INCLUDING_STDIO_H): Define this instead of
__need_FILE, as the latter does not work with glibc.

4 years agofcntl: document some F_SETLK errno variations
Paul Eggert [Sun, 2 Aug 2020 23:54:07 +0000 (16:54 -0700)]
fcntl: document some F_SETLK errno variations

* doc/posix-functions/fcntl.texi (fcntl): Document
OpenIndiana, GNU/Linux, FreeBSD on NFS files.

4 years agooset: Add an 'iterator_atleast' operation.
Bruno Haible [Sun, 2 Aug 2020 18:57:11 +0000 (20:57 +0200)]
oset: Add an 'iterator_atleast' operation.

* lib/gl_array_oset.c (gl_array_indexof_atleast): New function,
extracted from gl_array_search_atleast.
(gl_array_search_atleast): Use it.
(gl_array_iterator_atleast): New function.
(gl_array_oset_implementation): Use it.
* lib/gl_anytree_oset.h (gl_tree_iterator_atleast): New function.
* lib/gl_avltree_oset.c (gl_avltree_oset_implementation): Use it.
* lib/gl_rbtree_oset.c (gl_rbtree_oset_implementation): Likewise.
* lib/gl_oset.h (struct gl_oset_implementation): Add 'iterator_atleast'
member.
(gl_oset_iterator_atleast): New function.
* lib/gl_oset.hh (gl_OSet): Add 'begin_atleast' member.
(gl_OSet::iterator): Add another auxiliary constructor.
* tests/test-array_oset.c (is_at_least, gl_sortedlist_indexof_atleast):
New functions.
(main): Test also gl_oset_iterator_atleast.
* tests/test-avltree_oset.c (is_at_least): New function.
(main): Test also gl_oset_iterator_atleast.
* tests/test-rbtree_oset.c (is_at_least): New function.
(main): Test also gl_oset_iterator_atleast.
* tests/test-oset-c++.cc (is_at_most): New function.
(main): Test also gl_OSet::begin_atleast.

4 years agooset-c++, omap-c++: Remove restriction for search_atleast method.
Bruno Haible [Sun, 2 Aug 2020 18:19:31 +0000 (20:19 +0200)]
oset-c++, omap-c++: Remove restriction for search_atleast method.

* lib/gl_oset.hh (gl_OSet::search_atleast): Allow the threshold to be of
a different type than the element.
* lib/gl_omap.hh (gl_OMap::search_atleast): Allow the threshold to be of
a different type than the key.

4 years agognumakefile: say ‘$(MAKE)’ not ‘make’
Paul Eggert [Sat, 1 Aug 2020 23:19:37 +0000 (16:19 -0700)]
gnumakefile: say ‘$(MAKE)’ not ‘make’

* top/GNUmakefile (abort-due-to-no-makefile):
Prefer ‘$(MAKE)’ to ‘make’ in a diagnostic.
This change is backported from Autoconf.

4 years agoPrefer documented autoconf macro 'm4_if' over 'ifelse'.
Bruno Haible [Sat, 1 Aug 2020 20:37:05 +0000 (22:37 +0200)]
Prefer documented autoconf macro 'm4_if' over 'ifelse'.

* m4/autobuild.m4 (AB_INIT): Use m4_if instead of ifelse.
* m4/csharpexec.m4 (gt_CSHARPEXEC): Likewise.
* m4/javacomp.m4 (gt_JAVACOMP): Likewise.
* m4/javaexec.m4 (gt_JAVAEXEC): Likewise.
* m4/libtextstyle.m4 (gl_LIBTEXTSTYLE): Likewise.

4 years agolibtextstyle-optional: Update tests.
Bruno Haible [Sat, 1 Aug 2020 18:48:44 +0000 (20:48 +0200)]
libtextstyle-optional: Update tests.

* modules/libtextstyle-optional-tests (configure.ac): Invoke
gl_LIBTEXTSTYLE_OPTIONAL.

4 years agoparse-datetime: Fix wrong #line statements.
Bruno Haible [Sat, 1 Aug 2020 14:02:16 +0000 (16:02 +0200)]
parse-datetime: Fix wrong #line statements.

* modules/parse-datetime (Makefile.am): Correct #line statements also in
parse-datetime-gen.h.

4 years agolibtextstyle[-optional]: Allow requesting a minimum version.
Bruno Haible [Sat, 1 Aug 2020 13:04:52 +0000 (15:04 +0200)]
libtextstyle[-optional]: Allow requesting a minimum version.

* m4/libtextstyle.m4 (gl_LIBTEXTSTYLE): Allow an optional argument.
(gl_LIBTEXTSTYLE_NEWEST_VERSION, gl_LIBTEXTSTYLE_INITIALIZE,
gl_LIBTEXTSTYLE_SEARCH): New macros.
* modules/libtextstyle (configure.ac): Don't invoke gl_LIBTEXTSTYLE.
* m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Allow an
optional argument. Invoke, not require, gl_LIBTEXTSTYLE.
* modules/libtextstyle-optional (configure.ac): Don't invoke
gl_LIBTEXTSTYLE_OPTIONAL.
* NEWS: Mention the changes.

4 years ago_GL_CMP: Improve documentation.
Bruno Haible [Fri, 31 Jul 2020 09:32:02 +0000 (11:32 +0200)]
_GL_CMP: Improve documentation.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-07/msg00188.html>.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Clarify what arguments can be
passed.

4 years agolargefile: sync with Autoconf master
Paul Eggert [Fri, 31 Jul 2020 02:12:44 +0000 (19:12 -0700)]
largefile: sync with Autoconf master

* m4/largefile.m4 (_AC_SYS_LARGEFILE_TEST_INCLUDES):
Avoid undefined behavior on platforms where off_t is 32 bits.
See: https://bugs.debian.org/742780

4 years agoalloca: sync with Autoconf master
Paul Eggert [Fri, 31 Jul 2020 02:06:49 +0000 (19:06 -0700)]
alloca: sync with Autoconf master

* m4/alloca.m4 (_AC_LIBOBJ_ALLOCA):
Do not define if Autoconf 2.70 or later, since Autoconf master
now matches us.

4 years agounicodeio: Add comment.
Bruno Haible [Thu, 30 Jul 2020 18:20:57 +0000 (20:20 +0200)]
unicodeio: Add comment.

* lib/unicodeio.c (unicode_to_mb): Clarify why the code distinguishes
different iconv behaviours.

4 years agoWork around some Oracle Studio attribute bugs
Paul Eggert [Thu, 30 Jul 2020 16:27:18 +0000 (09:27 -0700)]
Work around some Oracle Studio attribute bugs

These were discovered when building bleeding-edge Emacs with
Oracle Studio.
* m4/gnulib-common.m4 (_GL_ATTRIBUTE_COLD, _GL_ATTRIBUTE_MAY_ALIAS):
Port to Oracle Studio 12.6, which mishandles __attribute__
((__cold__)) and __attribute__ ((__may_alias__)) even though
__has_attribute says they work.

4 years agounicodeio: Fix wrong result on musl libc.
Bruno Haible [Thu, 30 Jul 2020 01:29:29 +0000 (03:29 +0200)]
unicodeio: Fix wrong result on musl libc.

Reported by A. Wilcox <awilfox@adelielinux.org> in
<https://www.openwall.com/lists/musl/2020/07/29/2>.

* lib/unicodeio.c (unicode_to_mb): Handle asterisk fallback characters
on musl libc.
* m4/unicodeio.m4 (gl_UNICODEIO): Invoke gl_MUSL_LIBC.
* modules/unicodeio (Files): Add m4/musl.m4.

4 years agofsusage, regex, stat-size: remove Cray support
Paul Eggert [Wed, 29 Jul 2020 20:39:37 +0000 (13:39 -0700)]
fsusage, regex, stat-size: remove Cray support

As near as I can make out this is actually support for UNICOS/mp,
last released 2005, and Cray hasn’t supported that for years.
* config/srclist.txt: Comment out regex.h for now.
* lib/fsusage.c (get_fs_usage):
* lib/regex.h (re_comp, re_exec):
* lib/stat-size.h (ST_NBLOCKSIZE):
Don’t worry about _CRAY.

4 years agoFix last ChangeLog entry.
Bruno Haible [Wed, 29 Jul 2020 16:24:13 +0000 (18:24 +0200)]
Fix last ChangeLog entry.

4 years agoparse-datetime: Fix compilation error with bison 3.7.
Bruno Haible [Wed, 29 Jul 2020 16:18:18 +0000 (18:18 +0200)]
parse-datetime: Fix compilation error with bison 3.7.

* modules/parse-datetime (Makefile.am): Create a generated header file
parse-datetime-gen.h in the source directory. Correct #include and

4 years agofopen-gnu: Create files correctly (regression from 2020-05-24).
Bruno Haible [Tue, 28 Jul 2020 19:01:06 +0000 (21:01 +0200)]
fopen-gnu: Create files correctly (regression from 2020-05-24).

* lib/fopen.c (rpl_open): Pass a third argument to open().

4 years agoxalloc-die: don’t depend on xalloc
Paul Eggert [Tue, 28 Jul 2020 00:21:51 +0000 (17:21 -0700)]
xalloc-die: don’t depend on xalloc

This removes a circular dependency, as xalloc depends on xalloc-die.
* modules/xalloc-die (Files): Add lib/xalloc.h.
(Depends-on): Remove xalloc.
Add extern-inline, stdint, xalloc-oversized (this is for xalloc.h).

4 years agodfa-tests: port to MSVC
Paul Eggert [Mon, 27 Jul 2020 19:57:45 +0000 (12:57 -0700)]
dfa-tests: port to MSVC

Problem reported by Gisle Vanem in:
https://lists.gnu.org/r/bug-gnulib/2020-07/msg00159.html
Also, remove an unnecessary dependency on getprogname.
* modules/dfa-tests (Depends-on): Remove getprogname.
* tests/test-dfa-match-aux.c: Do not include getprogname.h.
(exit_status): New static var.
(dfawarn): Set it instead of exiting.
Do not declare as _Noreturn, to pacify MSVC.
(main): Return exit_status.

4 years agoautoupdate
Paul Eggert [Sun, 26 Jul 2020 22:17:46 +0000 (15:17 -0700)]
autoupdate

4 years agoargz: pacify MSVC
Paul Eggert [Sun, 26 Jul 2020 21:38:48 +0000 (14:38 -0700)]
argz: pacify MSVC

* lib/argz.in.h: Avoid "*/*" to pacify MSVC.
Problem reported by Gisle Vanem.

4 years agolibgmp: remove dependency on havelib
Paul Eggert [Sun, 26 Jul 2020 16:57:47 +0000 (09:57 -0700)]
libgmp: remove dependency on havelib

* m4/libgmp.m4 (gl_LIBGMP): If gl_HAVE_MODULE_HAVELIB is not defined,
use the more-traditional AC_SEARCH_LIBS approach.
This should work better with GNU Emacs configuration,
which uses pkg-config instead of a havelib-style approach.
* modules/havelib (gl_HAVE_MODULE_HAVELIB): New witness macro.
* modules/libgmp (Depends-on): Remove havelib.

4 years agolibgmp: remove HAVE_GMP, LIB_GMP
Paul Eggert [Sun, 26 Jul 2020 00:42:18 +0000 (17:42 -0700)]
libgmp: remove HAVE_GMP, LIB_GMP

* m4/libgmp.m4 (gl_LIBGMP): Do not define HAVE_GMP and LIB_GMP, as
they’re redundant.  I’ll adjust GNU Coreutils accordingly.