]> Savannah Git Hosting - gnulib.git/log
gnulib.git
3 years agognulib-tool: Fix handling of module libtextstyle-optional.
Bruno Haible [Sat, 25 Dec 2021 13:30:57 +0000 (14:30 +0100)]
gnulib-tool: Fix handling of module libtextstyle-optional.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00152.html>.

* gnulib-tool (func_repeat_module_in_tests): New function.
(func_emit_tests_Makefile_am, func_create_testdir): Use it for the file
list and when creating tests/Makefile.am.

3 years agognulib-tool: Respect applicability 'all' without --single-configure.
Bruno Haible [Sat, 25 Dec 2021 11:19:13 +0000 (12:19 +0100)]
gnulib-tool: Respect applicability 'all' without --single-configure.

* gnulib-tool (func_verify_tests_module): Treat modules with
applicability 'all' like 'tests' modules, not like 'main' modules.

3 years agoFix typo in newest ChangeLog entry.
Bruno Haible [Sat, 25 Dec 2021 04:01:23 +0000 (05:01 +0100)]
Fix typo in newest ChangeLog entry.

3 years agomaint: avoid empty lines in recipes
Paul Eggert [Sat, 25 Dec 2021 01:22:00 +0000 (17:22 -0800)]
maint: avoid empty lines in recipes

AIX 7.2 ‘make’ complains about recipe lines that are empty after
macro expansion, and I suppose there’s a good chance some
non-POSIX ‘make’ would prohibit them.  Rework macros so
that we can avoid them.
* gnulib-tool (func_emit_lib_Makefile_am)
(func_emit_lib_Makefile_am): Support @!NMD@ too.
* modules/gen-header (@gl_V_at): New macro.
* modules/alloca-opt, modules/argz, modules/assert-h:
* modules/byteswap, modules/configmake, modules/ctype:
* modules/dirent, modules/errno, modules/execinfo, modules/fcntl-h:
* modules/float, modules/fnmatch-h, modules/getopt-posix:
* modules/glob-h, modules/iconv-h, modules/ieee754-h:
* modules/inttypes-incomplete, modules/langinfo:
* modules/libtextstyle-optional, modules/limits-h, modules/locale:
* modules/malloc-h, modules/math, modules/monetary, modules/netdb:
* modules/openmp-init, modules/poll-h, modules/posix-shell:
* modules/pthread-h, modules/pty, modules/sched, modules/search:
* modules/signal-h, modules/sigsegv, modules/snippet/link-warning:
* modules/spawn, modules/stdalign, modules/stdarg, modules/stdbool:
* modules/stddef, modules/stdint, modules/stdio, modules/stdlib:
* modules/stdnoreturn, modules/string, modules/strings:
* modules/sysexits, modules/termios, modules/threads-h:
* modules/time, modules/uchar, modules/unicase/base:
* modules/uniconv/base, modules/unictype/base, modules/unigbrk/base:
* modules/unilbrk/base, modules/uniname/base, modules/uninorm/base:
* modules/unistd, modules/unistdio/base, modules/unistr/base:
* modules/unitypes, modules/uniwbrk/base, modules/uniwidth/base:
* modules/utime-h, modules/wchar, modules/wctype-h:
Use it.

3 years agomaint: tight-scope-mk need not be read-only
Paul Eggert [Sat, 25 Dec 2021 01:22:00 +0000 (17:22 -0800)]
maint: tight-scope-mk need not be read-only

* top/maint.mk (tight-scope.mk): Don’t bother to make
tight-scope.mk read-only either.

3 years agomaint: break out '&& mv $@-t $@'
Paul Eggert [Sat, 25 Dec 2021 01:21:59 +0000 (17:21 -0800)]
maint: break out '&& mv $@-t $@'

* build-aux/git-version-gen, config/argz.mk, modules/configmake:
* modules/posix_spawnp-tests, modules/snippet/link-warning:
Break out '&& mv $@-t $@' to a separate line in the Make recipe,
as this makes things a bit easier to debug.

3 years agogen-header: new module
Paul Eggert [Sat, 25 Dec 2021 01:21:59 +0000 (17:21 -0800)]
gen-header: new module

Simplify header generation by using Makefile variables
defined by a new gen-header module.
* modules/gen-header: New module.
* modules/alloca-opt, modules/argz, modules/arpa_inet:
* modules/assert-h, modules/byteswap:
* modules/ctype, modules/dirent, modules/dynarray, modules/errno:
* modules/execinfo, modules/fcntl-h, modules/float:
* modules/fnmatch-h, modules/getopt-posix, modules/glob-h:
* modules/iconv-h, modules/ieee754-h, modules/inttypes-incomplete:
* modules/langinfo, modules/libtextstyle-optional, modules/limits-h:
* modules/locale, modules/malloc-h, modules/math, modules/monetary:
* modules/net_if, modules/netdb, modules/netinet_in:
* modules/openmp-init, modules/poll-h:
* modules/pthread-h, modules/pty, modules/sched:
* modules/scratch_buffer, modules/search, modules/selinux-h:
* modules/signal-h, modules/sigsegv:
* modules/spawn, modules/stdalign, modules/stdarg, modules/stdbool:
* modules/stddef, modules/stdint, modules/stdio, modules/stdlib:
* modules/stdnoreturn, modules/string, modules/strings:
* modules/sys_file, modules/sys_ioctl, modules/sys_random:
* modules/sys_resource, modules/sys_select, modules/sys_socket:
* modules/sys_stat, modules/sys_time, modules/sys_times:
* modules/sys_types, modules/sys_uio, modules/sys_utsname:
* modules/sys_wait, modules/sysexits, modules/termios:
* modules/threads-h, modules/time, modules/uchar:
* modules/unicase/base, modules/unicase/special-casing:
* modules/uniconv/base, modules/unictype/base, modules/unigbrk/base:
* modules/unilbrk/base, modules/uniname/base, modules/uninorm/base:
* modules/unistd, modules/unistdio/base, modules/unistr/base:
* modules/unitypes, modules/uniwbrk/base, modules/uniwidth/base:
* modules/utime-h, modules/wchar, modules/wctype-h:
Depend on gen-header, and use its macros to simplify
header generation.

3 years agopassfd: Fix compilation error on IRIX.
Bruno Haible [Fri, 24 Dec 2021 19:51:37 +0000 (20:51 +0100)]
passfd: Fix compilation error on IRIX.

* lib/passfd.c (sendfd): On IRIX, ignore CMSG_FIRSTHDR.
(recvfd): Likewise. Produce a fake error ENOTCONN.

3 years agotests: Fix link errors on AIX.
Bruno Haible [Fri, 24 Dec 2021 18:43:11 +0000 (19:43 +0100)]
tests: Fix link errors on AIX.

* modules/fnmatch-h-c++-tests (Makefile.am): Link test-fnmatch-h-c++
with $(LIB_MBRTOWC).
* modules/glob-h-c++-tests (Makefile.am): Link test-glob-h-c++ with
$(LIB_MBRTOWC).
* modules/stdlib-c++-tests (Makefile.am): Link test-stdlib-c++ with
$(GETLOADAVG_LIBS).
* modules/sys_stat-c++-tests (Makefile.am): Link test-sys_stat-c++ with
$(LIB_MBRTOWC).
* modules/uchar-c++-tests (Makefile.am): Link test-uchar-c++ with
$(LIBUNISTRING).

3 years agohamt tests: Fix compilation error with AIX xlc.
Bruno Haible [Fri, 24 Dec 2021 18:31:27 +0000 (19:31 +0100)]
hamt tests: Fix compilation error with AIX xlc.

* tests/test-hamt.c (test_iterator): Don't use compound initializer.

3 years agostrerrorname_np: Fix compilation error on IRIX.
Bruno Haible [Fri, 24 Dec 2021 17:50:45 +0000 (18:50 +0100)]
strerrorname_np: Fix compilation error on IRIX.

* lib/strerrorname_np.c (strerrorname_np): Handle conflict between
EDIRCORRUPTED and EFSCORRUPTED.
* tests/test-strerrorname_np.c (main): Likewise.

3 years agohamt: Fix compilation error on NetBSD 7.
Bruno Haible [Fri, 24 Dec 2021 16:32:20 +0000 (17:32 +0100)]
hamt: Fix compilation error on NetBSD 7.

* lib/hamt.h (GL_HAMT_THREAD_SAFE): Define to 0 if the compiler is a
GCC version < 4.9.

3 years agosearch: Fix compilation errors with SunPRO C++ on Solaris 10.
Bruno Haible [Fri, 24 Dec 2021 15:51:31 +0000 (16:51 +0100)]
search: Fix compilation errors with SunPRO C++ on Solaris 10.

* lib/search.in.h (_gl_lsearch_compar_fn): New type.
(lfind, lsearch): Use it.

3 years agoqsort_r: Fix compilation error with SunPRO C++ on Solaris 10.
Bruno Haible [Fri, 24 Dec 2021 15:46:27 +0000 (16:46 +0100)]
qsort_r: Fix compilation error with SunPRO C++ on Solaris 10.

* lib/stdlib.in.h (_gl_qsort_r_compar_fn): New type.
(qsort_r): Use it.
* tests/test-stdlib-c++.cc (qsort_r): Don't test with SunPRO C++.

3 years agothreads-h tests: Avoid clang warnings.
Bruno Haible [Fri, 24 Dec 2021 15:39:26 +0000 (16:39 +0100)]
threads-h tests: Avoid clang warnings.

* tests/test-threads.c (main): Add 'default' to switch statements.

3 years agodoc: Small updates.
Bruno Haible [Fri, 24 Dec 2021 15:29:58 +0000 (16:29 +0100)]
doc: Small updates.

* doc/glibc-functions/ptsname_r.texi: Update info regarding Mac OS X.
* doc/posix-functions/getlogin_r.texi: Update info regarding FreeBSD.

3 years agolibgmp: omit redundant 'mkdir -p .'
Paul Eggert [Wed, 22 Dec 2021 18:57:36 +0000 (10:57 -0800)]
libgmp: omit redundant 'mkdir -p .'

* modules/libgmp: Mark $(MKDIR) with @NMD@; this was missed
in a previous pass.

3 years agomaint: omit unnecessary ‘rm -f $@-t $@’
Paul Eggert [Wed, 22 Dec 2021 18:57:36 +0000 (10:57 -0800)]
maint: omit unnecessary ‘rm -f $@-t $@’

* modules/alloca-opt, modules/argz, modules/arpa_inet:
* modules/assert-h, modules/byteswap, modules/configmake:
* modules/ctype, modules/dirent, modules/dynarray, modules/errno:
* modules/execinfo, modules/fcntl-h, modules/float:
* modules/fnmatch-h, modules/getopt-posix, modules/glob-h:
* modules/iconv-h, modules/ieee754-h, modules/inttypes-incomplete:
* modules/langinfo, modules/libtextstyle-optional:
* modules/limits-h, modules/langinfo, modules/libgmp, modules/limits-h:
* modules/locale, modules/malloc-h, modules/math, modules/monetary:
* modules/net_if, modules/netdb, modules/netinet_in:
* modules/openmp-init, modules/poll-h, modules/posix-shell:
* modules/posix_spawnp-tests, modules/pthread-h, modules/pty:
* modules/sched, modules/scratch_buffer, modules/search:
* modules/selinux-h, modules/signal-h, modules/sigsegv:
* modules/snippet/link-warning, modules/spawn, modules/stdalign:
* modules/stdarg, modules/stdbool, modules/stddef, modules/stdint:
* modules/stdio, modules/stdlib, modules/stdnoreturn:
* modules/string, modules/strings, modules/sys_file:
* modules/sys_ioctl, modules/sys_random, modules/sys_resource:
* modules/sys_select, modules/sys_socket, modules/sys_stat:
* modules/sys_time, modules/sys_times, modules/sys_types:
* modules/sys_uio, modules/sys_utsname, modules/sys_wait:
* modules/sysexits, modules/termios, modules/threads-h:
* modules/time, modules/uchar, modules/unicase/base:
* modules/unicase/special-casing, modules/uniconv/base:
* modules/unictype/base, modules/unigbrk/base, modules/unilbrk/base:
* modules/uniname/base, modules/uninorm/base, modules/unistd:
* modules/unistdio/base, modules/unistr/base, modules/unitypes:
* modules/uniwbrk/base, modules/uniwidth/base, modules/utime-h:
* modules/wchar, modules/wctype-h:
Don’t bother to do a ‘rm -f $@-t $@’ at the start of recipes that
create .h and similar files.  This is a revenant of a style in
which the files were created read-only.  Also, consistently use
use plain ‘mv $@-t $@’ afterwards, instead of usually using
‘mv -f’ but sometimes plain ‘mv’.

3 years agoFix recent ChangeLog entry.
Bruno Haible [Wed, 22 Dec 2021 18:15:54 +0000 (19:15 +0100)]
Fix recent ChangeLog entry.

3 years agomaint: fix __clang_major__ misspellings
Paul Eggert [Tue, 21 Dec 2021 23:24:03 +0000 (15:24 -0800)]
maint: fix __clang_major__ misspellings

The intprops.h typo fix should fix a bug in Emacs on Debian testing
with clang <https://bugs.gnu.org/52711>.
* lib/asyncsafe-spin.c, lib/intprops.h, lib/pthread-spin.c:
Fix some misspellings of ‘__clang_major__’.
I left one misspelling alone, in lib/cdefs.h,
and instead reported that bug upstream here:
https://sourceware.org/pipermail/libc-alpha/2021-December/134512.html

3 years agoget_ppid_of, get_progname_of: Fix runtime error on Mac OS X < 10.5.
Bruno Haible [Tue, 21 Dec 2021 20:38:30 +0000 (21:38 +0100)]
get_ppid_of, get_progname_of: Fix runtime error on Mac OS X < 10.5.

Reported by Evan Miller <emmiller@gmail.com>
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00081.html>.

* lib/get_ppid_of.c (proc_pidinfo): Declare with WEAK_IMPORT_ATTRIBUTE.
(get_ppid_of): Test whether the symbol declared weak evaluates to
non-NULL before invoking it.
* lib/get_progname_of (get_progname_of): Declare with
WEAK_IMPORT_ATTRIBUTE.
(get_ppid_of): Test whether the symbol declared weak evaluates to
non-NULL before invoking it.

3 years agoMove AM_V_GEN to recipe start
Paul Eggert [Tue, 21 Dec 2021 18:43:56 +0000 (10:43 -0800)]
Move AM_V_GEN to recipe start

This is especially needed when building Emacs, as it uses
‘AM_V_GEN=@$(info GEN $@)', which means the GEN line is output by
GNU make just before the recipe runs, regardless of where AM_V_GEN
appears in the recipe.  And it’s also good practice even if the
default Automake ‘AM_V_GEN=@echo GEN $@;’ is used, as it’s better
to output the GEN line consistently at the start of every recipe,
even if this precedes a preparatory command that almost always
works silently.
* modules/arpa_inet, modules/dynarray, modules/net_if:
* modules/netinet_in, modules/scratch_buffer, modules/selinux-h:
* modules/sys_file, modules/sys_ioctl, modules/sys_random:
* modules/sys_resource, modules/sys_select, modules/sys_socket:
* modules/sys_stat, modules/sys_time, modules/sys_times:
* modules/sys_types, modules/sys_uio, modules/sys_utsname:
* modules/sys_wait, modules/unicase/special-casing, top/maint.mk:
Use AM_V_GEN only at the start of each recipe.

3 years agoc-xvasprintf: Fix declarations (regression 2021-08-07).
Bruno Haible [Tue, 21 Dec 2021 16:47:48 +0000 (17:47 +0100)]
c-xvasprintf: Fix declarations (regression 2021-08-07).

* lib/c-xvasprintf.h (c_xasprintf, c_xvasprintf): Remove
_GL_ATTRIBUTE_RETURNS_NONNULL attribute.

3 years agosnippet/warn-on-use: Fix compilation error in C++ mode on OpenBSD 7.0.
Bruno Haible [Tue, 21 Dec 2021 14:10:25 +0000 (15:10 +0100)]
snippet/warn-on-use: Fix compilation error in C++ mode on OpenBSD 7.0.

* lib/warn-on-use.h (_GL_WARN_ON_USE): In C++ mode, declare function
with "C" linkage.

3 years agoOptimize redundant 'mkdir -p .' invocations.
Bruno Haible [Tue, 21 Dec 2021 08:59:17 +0000 (09:59 +0100)]
Optimize redundant 'mkdir -p .' invocations.

Reported by Paul Eggert.

* gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am):
Eliminate @NMD@ tokens.
* modules/alloca-opt (Makefile.am): Prefix the "$(MKDIR_P) '%reldir%'"
line with @NMD@.
* modules/argz (Makefile.am): Likewise.
* modules/assert-h (Makefile.am): Likewise.
* modules/byteswap (Makefile.am): Likewise.
* modules/configmake (Makefile.am): Likewise.
* modules/ctype (Makefile.am): Likewise.
* modules/dirent (Makefile.am): Likewise.
* modules/errno (Makefile.am): Likewise.
* modules/execinfo (Makefile.am): Likewise.
* modules/fcntl-h (Makefile.am): Likewise.
* modules/float (Makefile.am): Likewise.
* modules/fnmatch-h (Makefile.am): Likewise.
* modules/getopt-posix (Makefile.am): Likewise.
* modules/glob-h (Makefile.am): Likewise.
* modules/iconv-h (Makefile.am): Likewise.
* modules/ieee754-h (Makefile.am): Likewise.
* modules/inttypes-incomplete (Makefile.am): Likewise.
* modules/langinfo (Makefile.am): Likewise.
* modules/libtextstyle-optional (Makefile.am): Likewise.
* modules/limits-h (Makefile.am): Likewise.
* modules/locale (Makefile.am): Likewise.
* modules/malloc-h (Makefile.am): Likewise.
* modules/math (Makefile.am): Likewise.
* modules/monetary (Makefile.am): Likewise.
* modules/netdb (Makefile.am): Likewise.
* modules/openmp-init (Makefile.am): Likewise.
* modules/poll-h (Makefile.am): Likewise.
* modules/posix-shell (Makefile.am): Likewise.
* modules/pthread-h (Makefile.am): Likewise.
* modules/pty (Makefile.am): Likewise.
* modules/sched (Makefile.am): Likewise.
* modules/search (Makefile.am): Likewise.
* modules/signal-h (Makefile.am): Likewise.
* modules/sigsegv (Makefile.am): Likewise.
* modules/snippet/link-warning (Makefile.am): Likewise.
* modules/spawn (Makefile.am): Likewise.
* modules/stdalign (Makefile.am): Likewise.
* modules/stdarg (Makefile.am): Likewise.
* modules/stdbool (Makefile.am): Likewise.
* modules/stddef (Makefile.am): Likewise.
* modules/stdint (Makefile.am): Likewise.
* modules/stdio (Makefile.am): Likewise.
* modules/stdlib (Makefile.am): Likewise.
* modules/stdnoreturn (Makefile.am): Likewise.
* modules/string (Makefile.am): Likewise.
* modules/strings (Makefile.am): Likewise.
* modules/sysexits (Makefile.am): Likewise.
* modules/termios (Makefile.am): Likewise.
* modules/threads-h (Makefile.am): Likewise.
* modules/time (Makefile.am): Likewise.
* modules/uchar (Makefile.am): Likewise.
* modules/unicase/base (Makefile.am): Likewise.
* modules/uniconv/base (Makefile.am): Likewise.
* modules/unictype/base (Makefile.am): Likewise.
* modules/unigbrk/base (Makefile.am): Likewise.
* modules/unilbrk/base (Makefile.am): Likewise.
* modules/uniname/base (Makefile.am): Likewise.
* modules/uninorm/base (Makefile.am): Likewise.
* modules/unistd (Makefile.am): Likewise.
* modules/unistdio/base (Makefile.am): Likewise.
* modules/unistr/base (Makefile.am): Likewise.
* modules/unitypes (Makefile.am): Likewise.
* modules/uniwbrk/base (Makefile.am): Likewise.
* modules/uniwidth/base (Makefile.am): Likewise.
* modules/utime-h (Makefile.am): Likewise.
* modules/wchar (Makefile.am): Likewise.
* modules/wctype-h (Makefile.am): Likewise.

3 years agonon-recursive-gnulib-prefix-hack: Deprecate module.
Bruno Haible [Sun, 19 Dec 2021 16:30:55 +0000 (17:30 +0100)]
non-recursive-gnulib-prefix-hack: Deprecate module.

* modules/non-recursive-gnulib-prefix-hack (Status, Notice): New
sections.

3 years agognulib-tool: Don't insist on ACLOCAL_AMFLAGS.
Bruno Haible [Sun, 19 Dec 2021 11:49:16 +0000 (12:49 +0100)]
gnulib-tool: Don't insist on ACLOCAL_AMFLAGS.

Reported by Bjarni Ingi Gislason <bjarniig@rhi.hi.is> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00112.html>.

* gnulib-tool (func_import): Mention an AC_CONFIG_MACRO_DIRS invocation
as an alternative to augmenting ACLOCAL_AMFLAGS.
(--import, --add-import, --remove-import, --update): To find the m4
directories, look also for AC_CONFIG_MACRO_DIR and AC_CONFIG_MACRO_DIRS
invocations in configure.ac.

3 years agonstrftime: Update meta info.
Bruno Haible [Sat, 18 Dec 2021 21:45:00 +0000 (22:45 +0100)]
nstrftime: Update meta info.

* config/srclist.txt: Fix typo from 2017-07-23.

3 years agostdint: Fix handling of limits.h (regression 2021-12-16).
Bruno Haible [Sat, 18 Dec 2021 19:43:20 +0000 (11:43 -0800)]
stdint: Fix handling of limits.h (regression 2021-12-16).

* modules/stdint (configure.ac): Revert last change.
* gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am):
If --gnu-make is used, assume that AC_SUBSTed variables for conditionals
are constructed by appending the suffix '_CONDITION'.

3 years agonstrftime: simplify by using libc-config.h.
Paul Eggert [Sat, 18 Dec 2021 19:39:17 +0000 (11:39 -0800)]
nstrftime: simplify by using libc-config.h.

* lib/nstrftime.c [!_LIBC]: Include libc-config.h
instead of config.h.
(iso_week_days): Simplify via libc-config.h’s __inline.
(my_strftime): Simplify via libc-config.h’s libc_hidden_def.
* modules/nstrftime (Depends-on): Add libc-config.

3 years agolibtextstyle-optional: Fix generation of textstyle.h (regr. 2021-12-15).
Bruno Haible [Sat, 18 Dec 2021 16:22:01 +0000 (17:22 +0100)]
libtextstyle-optional: Fix generation of textstyle.h (regr. 2021-12-15).

* m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Invoke
gl_CONDITIONAL_HEADER.

3 years agoFix support for --gnu-make in tests (regression 2021-12-15).
Bruno Haible [Sat, 18 Dec 2021 13:10:19 +0000 (14:10 +0100)]
Fix support for --gnu-make in tests (regression 2021-12-15).

* gnulib-tool (func_emit_tests_Makefile_am): When producing output for
GNU make, eliminate %reldir% tokens.

3 years agogetopt-posix: Fix build on AIX (regression 2021-12-15).
Bruno Haible [Fri, 17 Dec 2021 23:26:13 +0000 (00:26 +0100)]
getopt-posix: Fix build on AIX (regression 2021-12-15).

* modules/getopt-posix (configure.ac): Arrange to generate
getopt-cdefs.h.
(Makefile.am): Separate the rules for getopt.h and getopt-cdefs.h.

3 years agoFix ChangeLog typo
Paul Eggert [Thu, 16 Dec 2021 21:15:58 +0000 (13:15 -0800)]
Fix ChangeLog typo

3 years agogetopt-posix,
Paul Eggert [Thu, 16 Dec 2021 21:13:27 +0000 (13:13 -0800)]
getopt-posix,

* modules/getopt-posix (getopt.h, getopt-cdefs.h):
Build only if GL_GENERATE_GETOPT_H.

3 years agostdint: omit duplicate gl_CONFIGURE_HEADER calls
Paul Eggert [Thu, 16 Dec 2021 20:40:14 +0000 (12:40 -0800)]
stdint: omit duplicate gl_CONFIGURE_HEADER calls

* modules/stdint (configure.ac): Omit
‘gl_CONDITIONAL_HEADER([limits.h])’, since stdint depends on
limits-h and doing gl_CONDITIONAL_HEADER twice can result in
‘configure’ failing with “*** GL_GENERATE_LIMITS_H is not set
correctly”.

3 years agoautoupdate
Karl Berry [Thu, 16 Dec 2021 15:43:21 +0000 (07:43 -0800)]
autoupdate

3 years agoautomake-subdir support: Support the libunistring modules.
Bruno Haible [Wed, 15 Dec 2021 22:24:48 +0000 (23:24 +0100)]
automake-subdir support: Support the libunistring modules.

* m4/libunistring-base.m4 (gl_LIBUNISTRING_LIBHEADER): Use the value of
the gl_source_base_prefix variable.

3 years agoautomake-subdir support: Support arbitrary --source-base value.
Bruno Haible [Wed, 15 Dec 2021 21:36:40 +0000 (22:36 +0100)]
automake-subdir support: Support arbitrary --source-base value.

Reported by Marc Nieper-Wißkirchen in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00066.html>.

* build-aux/prefix-gnulib-mk ($canon_prefix): New variable.
(prefix): Initialize it.
(prefix_assignment): Use it.

3 years agoautomake-subdir support: Look for 'subdir-objects' also in configure.ac.
Bruno Haible [Wed, 15 Dec 2021 20:49:41 +0000 (21:49 +0100)]
automake-subdir support: Look for 'subdir-objects' also in configure.ac.

* gnulib-tool: Look for the automake options also in the first argument
of the AM_INIT_AUTOMAKE invocation in configure.ac.

3 years agoAdd simple examples.
Bruno Haible [Wed, 15 Dec 2021 18:59:01 +0000 (19:59 +0100)]
Add simple examples.

* examples: New directory.

3 years agoAccommodate non-recursive Automake in a less hacky way.
Bruno Haible [Wed, 15 Dec 2021 18:18:31 +0000 (19:18 +0100)]
Accommodate non-recursive Automake in a less hacky way.

* gnulib-tool: New option --automake-subdir.
(automake_subdir): New variable.
(func_emit_initmacro_end): Add a second argument. Use it to prefix each
object file name in *_LIBOBJS and *_LTLIBOBJS.
(func_emit_shellvars_init): New function.
(func_import): Add support for --automake-subdir. Invoke
prefix-gnulib-mk. Update calls to func_emit_initmacro_end. Call
func_emit_shellvars_init.
(func_create_testdir): Update calls to func_emit_initmacro_end. Call
func_emit_shellvars_init.
* m4/gnulib-tool.m4 (gl_AUTOMAKE_SUBDIR): New macro.
* m4/gnulib-common.m4 (gl_CONDITIONAL_HEADER): Use the value of the
gl_source_base_prefix variable.
* build-aux/prefix-gnulib-mk: New options --from-gnulib-tool, --prefix.
(contents_of_file): Renamed from contents.
(contents_of_stdin): New function.
(process): Inline and remove function.
* doc/gnulib-tool.texi (Non-recursive make): New section.

3 years agoMove .h file names out of the *.m4 files.
Bruno Haible [Wed, 15 Dec 2021 18:18:25 +0000 (19:18 +0100)]
Move .h file names out of the *.m4 files.

This is useful because Autoconf macros defined in *.m4 files can be
AC_REQUIREd. In the configure file, they are then expanded before
gl_INIT, i.e. at a place where it is not known whether they are required
for the lib/ or for the tests/ directory (or both).

* m4/gnulib-common.m4 (gl_CONDITIONAL_HEADER): New macro.
* m4/alloca.m4 (gl_FUNC_ALLOCA): Set GL_GENERATE_ALLOCA_H instead of
ALLOCA_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/alloca-opt (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/argz.m4 (gl_FUNC_ARGZ): Set GL_GENERATE_ARGZ_H instead of ARGZ_H.
Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/argz (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/assert_h.m4 (gl_ASSERT_H): Set GL_GENERATE_ASSERT_H instead of
ASSERT_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/assert-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/byteswap.m4 (gl_BYTESWAP): Set GL_GENERATE_BYTESWAP_H instead of
BYTESWAP_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/byteswap (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/errno_h.m4 (gl_HEADER_ERRNO_H): Set GL_GENERATE_ERRNO_H instead of
ERRNO_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
(gl_REPLACE_ERRNO_VALUE): Update.
* m4/perror.m4 (gl_FUNC_PERROR): Update.
* m4/strerror.m4 (gl_FUNC_STRERROR): Update.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R, gl_FUNC_STRERROR_R_WORKS):
Update.
* modules/errno (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/execinfo.m4 (gl_EXECINFO_H): Set GL_GENERATE_EXECINFO_H instead of
EXECINFO_H. Drop AC_SUBST and AM_CONDITIONAL invocations. Drop AC_LIBOBJ
invocation.
* modules/execinfo (configure.ac): Invoke gl_CONDITIONAL_HEADER and
AC_LIBOBJ.
* m4/float_h.m4 (gl_FLOAT_H): Set GL_GENERATE_FLOAT_H instead of
FLOAT_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/float (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/fnmatch_h.m4 (gl_FNMATCH_H, gl_REPLACE_FNMATCH_H): Set
GL_GENERATE_FNMATCH_H instead of FNMATCH_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* modules/fnmatch-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* modules/fnmatch (configure.ac): Likewise.
* m4/getopt.m4 (gl_FUNC_GETOPT_POSIX, gl_GETOPT_SUBSTITUTE_HEADER): Set
GL_GENERATE_GETOPT_H instead of GETOPT_H. Set GL_GENERATE_GETOPT_CDEFS_H
instead of GETOPT_CDEFS_H. Drop AC_SUBST invocations.
* modules/getopt-posix (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/glob_h.m4 (gl_GLOB_H, gl_REPLACE_GLOB_H): Set GL_GENERATE_GLOB_H
instead of GLOB_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/glob-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* modules/glob (configure.ac): Likewise.
* m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS, gl_REPLACE_ICONV_H): Set
GL_GENERATE_ICONV_H instead of ICONV_H. Drop AC_SUBST and AM_CONDITIONAL
invocations.
(gl_ICONV_H): Update.
* modules/iconv-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* modules/iconv_open (configure.ac): Likewise.
* m4/ieee754-h.m4 (gl_IEEE754_H): Set GL_GENERATE_IEEE754_H instead of
IEEE754_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/ieee754-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/libgmp.m4 (gl_LIBGMP): Set GL_GENERATE_GMP_H instead of GMP_H. Drop
AC_SUBST invocation.
* modules/libgmp (configure.ac): Invoke gl_CONDITIONAL_HEADER.
(Makefile.am): Use GL_GENERATE_GMP_H.
* m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Set
GL_GENERATE_TEXTSTYLE_H instead of TEXTSTYLE_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* modules/libtextstyle-optional (configure.ac): Invoke
gl_CONDITIONAL_HEADER.
* m4/limits-h.m4 (gl_LIMITS_H, gl_REPLACE_LIMITS_H): Set
GL_GENERATE_LIMITS_H instead of LIMITS_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* modules/limits-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/monetary_h.m4 (gl_MONETARY_H): Set GL_GENERATE_MONETARY_H instead
of MONETARY_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/monetary (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/net_if_h.m4 (gl_HEADER_NET_IF): Set GL_GENERATE_NET_IF_H instead of
NET_IF_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/net_if (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/netinet_in_h.m4 (gl_HEADER_NETINET_IN): Set
GL_GENERATE_NETINET_IN_H instead of NETINET_IN_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* modules/netinet_in (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/selinux-context-h.m4 (gl_HEADERS_SELINUX_CONTEXT_H): Set
GL_GENERATE_SELINUX_CONTEXT_H instead of SELINUX_CONTEXT_H. Drop
AC_SUBST and AM_CONDITIONAL invocations.
* m4/selinux-label-h.m4 (gl_HEADERS_SELINUX_LABEL_H): Set
GL_GENERATE_SELINUX_LABEL_H instead of SELINUX_LABEL_H. Drop AC_SUBST
and AM_CONDITIONAL invocations.
* modules/selinux-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdalign.m4 (gl_STDALIGN_H): Set GL_GENERATE_STDALIGN_H instead of
STDALIGN_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/stdalign (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdarg.m4 (gl_STDARG_H): Set GL_GENERATE_STDARG_H instead of
STDARG_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/stdarg (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdbool.m4 (gl_STDBOOL_H): Renamed from AM_STDBOOL_H. Set
GL_GENERATE_STDBOOL_H instead of STDBOOL_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Don't require AM_STDBOOL_H.
* modules/stdbool (configure.ac): Invoke gl_STDBOOL_H instead of
AM_STDBOOL_H. Invoke gl_CONDITIONAL_HEADER.
* m4/stddef_h.m4 (gl_STDDEF_H): Set GL_GENERATE_STDDEF_H instead of
STDDEF_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/stddef (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdint.m4 (gl_STDINT_H): Set GL_GENERATE_STDINT_H instead of
STDINT_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): Update.
* modules/stdint (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdnoreturn.m4 (gl_STDNORETURN_H): Set GL_GENERATE_STDNORETURN_H
instead of STDNORETURN_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/stdnoreturn (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/sys_socket_h.m4 (gl_SYS_SOCKET_H): Set GL_GENERATE_SYS_SOCKET_H
instead of SYS_SOCKET_H.
* m4/sysexits.m4 (gl_SYSEXITS): Set GL_GENERATE_SYSEXITS_H instead of
SYSEXITS_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/sysexits (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* modules/sigsegv (configure.ac): Set GL_GENERATE_SIGSEGV_H instead of
SIGSEGV_H. Drop AC_SUBST and AM_CONDITIONAL invocations. Invoke
gl_CONDITIONAL_HEADER.

3 years agoFix creation of build directories with non-recursive-gnulib-prefix-hack.
Bruno Haible [Wed, 15 Dec 2021 18:18:20 +0000 (19:18 +0100)]
Fix creation of build directories with non-recursive-gnulib-prefix-hack.

This is necessary for executing "make" in a VPATH build of a package
that uses prefix-gnulib-mk and a module such as alloca-opt.

* modules/alloca-opt (Makefile.am): Before generating the .h-t file,
ensure that the directory in which we want to create it exists.
(configure.ac): Invoke AC_PROG_MKDIR_P.
* modules/argz: Likewise.
* modules/arpa_inet: Likewise.
* modules/assert-h: Likewise.
* modules/byteswap: Likewise.
* modules/configmake: Likewise.
* modules/ctype: Likewise.
* modules/dirent: Likewise.
* modules/dynarray: Likewise.
* modules/errno: Likewise.
* modules/execinfo: Likewise.
* modules/fcntl-h: Likewise.
* modules/float: Likewise.
* modules/fnmatch-h: Likewise.
* modules/getopt-posix: Likewise.
* modules/glob-h: Likewise.
* modules/iconv-h: Likewise.
* modules/ieee754-h: Likewise.
* modules/inttypes-incomplete: Likewise.
* modules/langinfo: Likewise.
* modules/libgmp: Likewise.
* modules/libtextstyle-optional: Likewise.
* modules/limits-h: Likewise.
* modules/locale: Likewise.
* modules/malloc-h: Likewise.
* modules/math: Likewise.
* modules/monetary: Likewise.
* modules/net_if: Likewise.
* modules/netdb: Likewise.
* modules/netinet_in: Likewise.
* modules/openmp-init: Likewise.
* modules/poll-h: Likewise.
* modules/posix-shell: Likewise.
* modules/pthread-h: Likewise.
* modules/pty: Likewise.
* modules/sched: Likewise.
* modules/scratch_buffer: Likewise.
* modules/search: Likewise.
* modules/selinux-h: Likewise.
* modules/signal-h: Likewise.
* modules/sigsegv: Likewise.
* modules/snippet/link-warning: Likewise.
* modules/spawn: Likewise.
* modules/stdalign: Likewise.
* modules/stdarg: Likewise.
* modules/stdbool: Likewise.
* modules/stddef: Likewise.
* modules/stdint: Likewise.
* modules/stdio: Likewise.
* modules/stdlib: Likewise.
* modules/stdnoreturn: Likewise.
* modules/string: Likewise.
* modules/strings: Likewise.
* modules/sys_file: Likewise.
* modules/sys_ioctl: Likewise.
* modules/sys_random: Likewise.
* modules/sys_resource: Likewise.
* modules/sys_select: Likewise.
* modules/sys_socket: Likewise.
* modules/sys_stat: Likewise.
* modules/sys_time: Likewise.
* modules/sys_times: Likewise.
* modules/sys_types: Likewise.
* modules/sys_uio: Likewise.
* modules/sys_utsname: Likewise.
* modules/sys_wait: Likewise.
* modules/sysexits: Likewise.
* modules/termios: Likewise.
* modules/threads-h: Likewise.
* modules/time: Likewise.
* modules/uchar: Likewise.
* modules/unicase/base: Likewise.
* modules/unicase/special-casing: Likewise.
* modules/uniconv/base: Likewise.
* modules/unictype/base: Likewise.
* modules/unigbrk/base: Likewise.
* modules/unilbrk/base: Likewise.
* modules/uniname/base: Likewise.
* modules/uninorm/base: Likewise.
* modules/unistd: Likewise.
* modules/unistdio/base: Likewise.
* modules/unistr/base: Likewise.
* modules/unitypes: Likewise.
* modules/uniwbrk/base: Likewise.
* modules/uniwidth/base: Likewise.
* modules/utime-h: Likewise.
* modules/wchar: Likewise.
* modules/wctype-h: Likewise.
* gnulib-tool (func_emit_lib_Makefile_am): When producing output for
GNU make, eliminate %reldir% tokens.

3 years agonon-recursive-gnulib-prefix-hack: Remove obsolete code.
Bruno Haible [Wed, 15 Dec 2021 18:13:53 +0000 (19:13 +0100)]
non-recursive-gnulib-prefix-hack: Remove obsolete code.

* build-aux/prefix-gnulib-mk (prefix): Remove handling of t-$@ pattern.

3 years agoIndentation fix.
Bruno Haible [Wed, 15 Dec 2021 18:12:13 +0000 (19:12 +0100)]
Indentation fix.

* m4/include_next.m4 (gl_NEXT_HEADERS_INTERNAL): Correct indentation.

3 years agoTweak recent ChangeLog entry.
Bruno Haible [Wed, 15 Dec 2021 18:10:25 +0000 (19:10 +0100)]
Tweak recent ChangeLog entry.

3 years agorenameatu: port to macOS tmpfs
Paul Eggert [Tue, 14 Dec 2021 20:32:30 +0000 (12:32 -0800)]
renameatu: port to macOS tmpfs

Problem reported by Sudhip Nashi (Bug#52193).
* lib/renameatu.c (renameat2ish) [HAVE_RENAMEAT]: New function.
(renameatu): Use the new function, to avoid a bug when
renameatx_np fails with errno == ENOTSUP.  Don’t try to support
RENAME_EXCHANGE; the old code didn’t work and nobody using using
RENAME_EXCHANGE anyway.

3 years agoautoupdate
Karl Berry [Mon, 13 Dec 2021 21:27:00 +0000 (13:27 -0800)]
autoupdate

3 years agoautoupdate
Karl Berry [Mon, 13 Dec 2021 16:06:51 +0000 (08:06 -0800)]
autoupdate

3 years agognulib-tool: Fix mistake in last commit.
Bruno Haible [Mon, 13 Dec 2021 02:03:13 +0000 (03:03 +0100)]
gnulib-tool: Fix mistake in last commit.

3 years agognulib-tool: Support non-recursive-gnulib-prefix-hack with tests.
Bruno Haible [Mon, 13 Dec 2021 01:43:21 +0000 (02:43 +0100)]
gnulib-tool: Support non-recursive-gnulib-prefix-hack with tests.

* gnulib-tool (func_import): Synthesize an AC_CONFIG_LIBOBJ_DIR
invocation.
* m4/non-recursive-gnulib-prefix-hack.m4
(gl_NON_RECURSIVE_GNULIB_PREFIX_HACK): Don't invoke
AC_CONFIG_LIBOBJ_DIR.

3 years agobootstrap: refactor for GNU tar
Paul Eggert [Mon, 13 Dec 2021 01:17:47 +0000 (17:17 -0800)]
bootstrap: refactor for GNU tar

* build-aux/bootstrap (gitignore_entries, insert_if_absent)
(insert_vc_ignore, symlink_to_dir): Define these shell functions
before including bootstrap.conf.  This is for GNU tar, whose
bootstrap.conf uses symlink_to_dir.

3 years agognulib-tool: Support different basenames for the lib/,tests/ Makefiles.
Bruno Haible [Mon, 13 Dec 2021 00:15:52 +0000 (01:15 +0100)]
gnulib-tool: Support different basenames for the lib/,tests/ Makefiles.

* m4/gnulib-tool.m4 (gl_TESTS_MAKEFILE_NAME): New macro.

3 years agognulib-tool: Support different basenames for the lib/,tests/ Makefiles.
Bruno Haible [Sun, 12 Dec 2021 20:13:54 +0000 (21:13 +0100)]
gnulib-tool: Support different basenames for the lib/,tests/ Makefiles.

* gnulib-tool: New option --tests-makefile-name.
(tests_makefile_name): New variable.
(func_import): Add support for --tests-makefile-name. Replace local
variable makefile_am with two local variables source_makefile_am,
tests_makefile_am.

3 years agoget_ppid_of, get_progname_of: Fix compilation error on Mac OS X < 10.5.
Bruno Haible [Sat, 11 Dec 2021 16:43:48 +0000 (17:43 +0100)]
get_ppid_of, get_progname_of: Fix compilation error on Mac OS X < 10.5.

Reported by Ryan Schmidt <gnulib@ryandesign.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00011.html>.

* lib/get_ppid_of.c: Include AvailabilityMacros.h
(get_ppid_of): Use MAC_OS_X_VERSION_MAX_ALLOWED and
MAC_OS_X_VERSION_MIN_REQUIRED.
* lib/get_progname_of: Include AvailabilityMacros.h
(get_progname_of): Use MAC_OS_X_VERSION_MAX_ALLOWED and
MAC_OS_X_VERSION_MIN_REQUIRED.

3 years agobackupfile: assume C99 decls
Paul Eggert [Fri, 10 Dec 2021 21:54:54 +0000 (13:54 -0800)]
backupfile: assume C99 decls

* lib/backupfile.c: Use C99-style decls after statements.

3 years agobackupfile: prefer signed integers
Paul Eggert [Fri, 10 Dec 2021 21:43:10 +0000 (13:43 -0800)]
backupfile: prefer signed integers

* lib/backupfile.c: Include ialloc.h instead of idx.h.
Prefer idx_t to size_t where either will do.
Use imalloc and irealloc instead of malloc and realloc.
* modules/backupfile, modules/backup-rename (Depends-on):
Depend on ialloc not idx.

3 years agobackupfile: fix numbered backups for XXX/
Paul Eggert [Fri, 10 Dec 2021 21:31:02 +0000 (13:31 -0800)]
backupfile: fix numbered backups for XXX/

This fixes Bug#52410 reported by Vincent Vermilya.
* lib/backupfile.c (check_extension): Return a bool indicating
whether the original extension was OK.  Caller changed.
(numbered_backup): Require that FILELEN does not count
trailing slashes after a non-slash, and don’t require
that *BUF be null-terminated.  Caller changed.
This fixes a bug where the numbered backup file name for X/ was
incorrectly computed because the trailing slash messed up the code
looking for X.~1~, X.~2~, etc., and this caused numbered_backup
to loop forever.  Also, check that check_extension doesn’t
truncate a file name leading to a different infloop.

3 years agoregex: pacify Coverity clean_state_log_if_needed
Paul Eggert [Tue, 7 Dec 2021 22:34:21 +0000 (14:34 -0800)]
regex: pacify Coverity clean_state_log_if_needed

Problem reported by Robbie Harwood in:
https://lists.gnu.org/r/bug-gnulib/2021-12/msg00005.html
* lib/regexec.c (clean_state_log_if_needed):
Add a DEBUG_ASSERT; this both pacifies Coverity and
will help to debug in case some other change mistakenly
causes the assertion to become false.

3 years agogettext-h: Optimize also for clang.
Bruno Haible [Tue, 7 Dec 2021 04:41:29 +0000 (05:41 +0100)]
gettext-h: Optimize also for clang.

* lib/gettext.h (pgettext_aux, npgettext_aux, dcpgettext_expr,
dcnpgettext_expr): Inline also on clang.

3 years agointprops: Break sync with glibc.
Bruno Haible [Mon, 6 Dec 2021 20:28:40 +0000 (21:28 +0100)]
intprops: Break sync with glibc.

* config/srclist.txt: Comment out intprops.h.

3 years agointprops: streamline and get ready for Clang 14
Paul Eggert [Mon, 6 Dec 2021 18:29:54 +0000 (10:29 -0800)]
intprops: streamline and get ready for Clang 14

* lib/intprops.h (_GL_HAS_BUILTIN_ADD_OVERFLOW):
Rely on __has_builtin first, since GCC didn’t introduce it until
GCC 9 so we don’t need to special-case GCC first.
(_GL_HAS_BUILTIN_ADD_OVERFLOW, _GL_HAS_BUILTIN_OVERFLOW_P):
Look at __EDG__ rather than __ICC, since icc defines __EDG__ too.
(_GL_HAS_BUILTIN_MUL_OVERFLOW): Define to 1 in Clang 14 and later,
as a bug fix is scheduled for Clang 14.
(_GL_HAS_BUILTIN_OVERFLOW_P): Do not bother to special-case
__clang__, since __has_builtin should do the right thing anyway.

3 years agointprops: Treat EDG-based compilers like Intel compilers.
Bruno Haible [Mon, 6 Dec 2021 16:47:05 +0000 (17:47 +0100)]
intprops: Treat EDG-based compilers like Intel compilers.

Reported by Ilya Kurdyukov <ilyakurdyukov@altlinux.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00028.html>.

* lib/intprops.h (_GL_HAS_BUILTIN_OVERFLOW_P): Define to 0 on EDG-based
compilers.

3 years agosigsegv: Fix build on some more embedded CPUs.
Bruno Haible [Mon, 6 Dec 2021 00:16:10 +0000 (01:16 +0100)]
sigsegv: Fix build on some more embedded CPUs.

* m4/stack-direction.m4 (SV_STACK_DIRECTION): Assume the stack grows
negative, when the GCC 11 sources say so.

3 years agosys_random: port better to uClibc < 1.0.35
Paul Eggert [Wed, 1 Dec 2021 01:50:01 +0000 (17:50 -0800)]
sys_random: port better to uClibc < 1.0.35

Problem reported by Fabrice Fontaine in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00043.html
* lib/sys_random.in.h [HAVE_SYS_RANDOM_H && !__GLIBC__ && __UCLIBC__]:
Include <stddef.h>, in case this file is included before
__UCLIBC__ is defined.

3 years agogettext-h: document GNULIB_NO_VLA
Paul Eggert [Sat, 27 Nov 2021 08:49:56 +0000 (00:49 -0800)]
gettext-h: document GNULIB_NO_VLA

* doc/gnulib-readme.texi (C99 features avoided):
Document GNULIB_NO_VLA.

3 years agogettext-h: use VLA test similar to regex
Paul Eggert [Sat, 27 Nov 2021 08:33:24 +0000 (00:33 -0800)]
gettext-h: use VLA test similar to regex

* lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Assuming
GNULIB_NO_VLA, define if (defined __STDC_VERSION__ && 199901L <=
__STDC_VERSION__ \ + && !defined __STDC_NO_VLA___), not if
((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__).
This is more consistent with what the regex module does.
* modules/gettext-h (Depends-on): Depend on vararrays, since
lib/gettext.h uses __STDC_NO_VLA__.

3 years agoregex: port to tcc
Paul Eggert [Sat, 27 Nov 2021 08:00:46 +0000 (00:00 -0800)]
regex: port to tcc

Problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00038.html
* modules/regex (Depends-on): Depend on vararrays, since
lib/regex.h uses __STDC_NO_VLA__.
* modules/vararrays: Change license from LGPL to LGPLv2+.

3 years agotest-framework-sh: remove unsafe entries from PATH
Bernhard Voelker [Wed, 24 Nov 2021 22:59:00 +0000 (23:59 +0100)]
test-framework-sh: remove unsafe entries from PATH

Running tests with '.' in the PATH may yield unspecified results,
and is deemed unsafe per se.  This includes empty entries as well
which are treated like a '.' entry as per POSIX.

* tests/init.sh (setup_): Add snippet to remove relative and non-
accessible entries from the PATH environment variable.

3 years agoregex: merge from glibc
Paul Eggert [Wed, 24 Nov 2021 17:33:46 +0000 (09:33 -0800)]
regex: merge from glibc

The main change here, imported from Glibc, is for the regex
code to stop using nested functions when _LIBC is defined.
The intent is for the result to be copied back to Glibc
so that the two implementations can resync.
* lib/regcomp.c (re_set_fastmap, seek_collating_symbol_entry)
(lookup_collation_sequence_value, build_range_exp)
(build_collating_symbol):
* lib/regexec.c (acquire_init_state_context):
Declare with __always_inline instead of with
‘inline __attribute__ ((always_inline))’.
* lib/regexec.c (init_word_char):
Move uint64_t comment to regex_internal.h.
(parse_byte): Change multibyte-detecting arg from re_charset_t *
to re_dfa_t const *.  All callers changed.
(build_range_exp, build_collating_symbol) [!_LIBC]:
Change signature to match _LIBC well enough so that the caller can
be simplified to assume _LIBC.
(parse_bracket_exp): Pull its nested functions
seek_collating_symbol_entry, lookup_collation_sequence_value,
build_range_exp, build_collating_symbol out to the top level,
adding args to pass the information instead of having them access
nonlocal vars.  Use types in local vars that do not assume glibc.
* lib/regex_internal.h: Explain uint64_t etc. here.

3 years agoregex: assume RE_ENABLE_I18N
Paul Eggert [Wed, 24 Nov 2021 01:34:45 +0000 (17:34 -0800)]
regex: assume RE_ENABLE_I18N

These days there is no longer any need to port to platforms
lacking iswctype etc., since Gnulib now has substitutes.
* config/srclist.txt: Comment out regex_internal.c and
regex_internal.h for now, since they no longer match glibc.
The intent is to merge them again soon.
* lib/regex_internal.h (RE_ENABLE_I18N): Remove.
All uses changed to assume that RE_ENABLE_I18N is 1.
* modules/regex (Depends-on): Add iswctype.

3 years agolseek: port around macOS SEEK_HOLE glitch
Paul Eggert [Tue, 16 Nov 2021 06:17:44 +0000 (22:17 -0800)]
lseek: port around macOS SEEK_HOLE glitch

Problem reported by Sudhip Nashi (Bug#51857#47).
* lib/lseek.c (rpl_lseek): Work around macOS lseek+SEEK_HOLE
returning -1 with ENXIO if there are no holes before EOF,
contrary to the macOS documentation.

3 years agolseek: port around macOS SEEK_DATA glitch
Paul Eggert [Mon, 15 Nov 2021 23:08:25 +0000 (15:08 -0800)]
lseek: port around macOS SEEK_DATA glitch

Problem reported by Sudhip Nashi (Bug#51857).
* doc/posix-functions/lseek.texi (lseek): Mention macOS SEEK_DATA
issue.
* lib/lseek.c (rpl_lseek): Work around macOS portability glitch.
* m4/lseek.m4 (gl_FUNC_LSEEK): Replace lseek on Darwin.
* modules/lseek (Depends-on): Depend on msvc-nothrow
and fstat only if needed.

3 years agoAdd ChangeLog entry for sigsegv changes
Paul Eggert [Fri, 12 Nov 2021 02:38:46 +0000 (18:38 -0800)]
Add ChangeLog entry for sigsegv changes

3 years agosigsegv: fix build on or1k
Fabrice Fontaine [Thu, 11 Nov 2021 09:06:31 +0000 (10:06 +0100)]
sigsegv: fix build on or1k

Fix the following build failure on or1k with diffutils 3.8
https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=e54aa6196947ed22ff66bcd714e4fc7bd0c5c3b4
sigsegv.c:979:28: error: 'struct vma_struct' has no member named 'is_near_this'
http://autobuild.buildroot.org/results/5427e52489d29ed4f18b4a70b3c36f0f7bb0ddd9

3 years agosigsegv: fix build on microblazeel
Fabrice Fontaine [Thu, 11 Nov 2021 08:57:23 +0000 (09:57 +0100)]
sigsegv: fix build on microblazeel

Fix the following build failure on microblazeel with diffutils 3.8:
sigsegv.c:979:28: error: 'struct vma_struct' has no member named 'is_near_this'
http://autobuild.buildroot.org/results/5ecd55b7c72f9630a7acc72341ccb60e94ddb574

3 years agoFix typos in previous patch.
Paul Eggert [Tue, 9 Nov 2021 18:06:22 +0000 (10:06 -0800)]
Fix typos in previous patch.

3 years agoexclude: yield proper errno on failure
Paul Eggert [Tue, 9 Nov 2021 17:50:28 +0000 (09:50 -0800)]
exclude: yield proper errno on failure

* lib/exclude.c (add_exclude_file): Do not assume that fclose
preserves errno on success.

3 years agoautoupdate
Karl Berry [Mon, 8 Nov 2021 15:21:39 +0000 (07:21 -0800)]
autoupdate

3 years agoregex: break regcomp.c link with glibc
Paul Eggert [Mon, 8 Nov 2021 07:31:08 +0000 (23:31 -0800)]
regex: break regcomp.c link with glibc

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00005.html
* config/srclist.txt: Comment out regcomp.c for now.
* lib/regcomp.c: Revert previous change.

3 years agoautoupdate
Karl Berry [Wed, 3 Nov 2021 15:06:20 +0000 (08:06 -0700)]
autoupdate

3 years ago* doc/gnulib-intro.texi: Fix some ancient history.
Paul Eggert [Tue, 2 Nov 2021 01:18:13 +0000 (18:18 -0700)]
* doc/gnulib-intro.texi: Fix some ancient history.

3 years agoautoupdate (belated)
Karl Berry [Thu, 28 Oct 2021 20:16:13 +0000 (13:16 -0700)]
autoupdate (belated)

3 years agostring: Avoid syntax error re strdup in string.in.h (regr. 2021-09-07).
Bruno Haible [Sun, 24 Oct 2021 22:34:24 +0000 (00:34 +0200)]
string: Avoid syntax error re strdup in string.in.h (regr. 2021-09-07).

Reported by Jan Engelhardt <jengelh@inai.de>
and by Arash Esbati <arash@gnu.org> via Andy Moreton in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-10/msg00058.html>.

* lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE,
_GL_ATTRIBUTE_MALLOC): Add fallback declarations, like in
lib/stdlib.in.h.
* lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE,
_GL_ATTRIBUTE_MALLOC): Likewise.

3 years agoautoupdate
Karl Berry [Thu, 21 Oct 2021 14:28:12 +0000 (07:28 -0700)]
autoupdate

3 years agoautoupdate
Karl Berry [Wed, 20 Oct 2021 13:54:34 +0000 (06:54 -0700)]
autoupdate

3 years agoxalloc: new function xinmalloc
Paul Eggert [Tue, 19 Oct 2021 23:31:32 +0000 (16:31 -0700)]
xalloc: new function xinmalloc

* lib/xmalloc.c (xinmalloc): New function, which is like
xnmalloc but for idx_t instead of size_t.

3 years agoregex: redo style of previous change
Paul Eggert [Tue, 19 Oct 2021 08:48:37 +0000 (01:48 -0700)]
regex: redo style of previous change

3 years agoregex: improve comment
Paul Eggert [Tue, 19 Oct 2021 08:07:56 +0000 (01:07 -0700)]
regex: improve comment

3 years agoregex: fix buffer read overrrun
Paul Eggert [Mon, 18 Oct 2021 21:50:16 +0000 (14:50 -0700)]
regex: fix buffer read overrrun

* config/srclist.txt: Remove posix/regexec.c for now.
* lib/regexec.c (re_search_internal):
Fix buffer read overrun reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2021-10/msg00035.html

3 years agonproc: port better to macOS 10.14
Paul Eggert [Sat, 16 Oct 2021 02:33:46 +0000 (19:33 -0700)]
nproc: port better to macOS 10.14

* lib/nproc.c (num_processors_ignoring_omp)
[HAVE_SYSCTL && !defined __GLIBC__ && defined HW_NCPU]:
Do not use a const mib, as macOS 10.14 rejects this.

3 years agosigsegv: fix quoting problem
Paul Eggert [Wed, 13 Oct 2021 17:24:40 +0000 (10:24 -0700)]
sigsegv: fix quoting problem

Problem reported for FreeBSD ports by Alexey Dokuchaev in:
https://bugs.gnu.org/51144
* m4/stack-direction.m4 (SV_STACK_DIRECTION): Quote brackets.

3 years agonproc: port better to OpenBSD
Paul Eggert [Sun, 10 Oct 2021 17:43:47 +0000 (10:43 -0700)]
nproc: port better to OpenBSD

Problem reported by Omar Polo in:
https://lists.gnu.org/r/emacs-devel/2021-10/msg00692.html
* lib/nproc.c (num_processors_ignoring_omp): Prefer HW_NCPUONLINE
to HW_NCPU, for OpenBSD.  Also, make mib const.

3 years agotimer-time: port better to OpenBSD 6.9
Paul Eggert [Sun, 3 Oct 2021 00:50:48 +0000 (17:50 -0700)]
timer-time: port better to OpenBSD 6.9

* m4/timer_time.m4 (gl_TIMER_TIME): Also require timer_settime to
be declared, as it exists in OpenBSD but always fails with ENOSYS.

3 years agosys_select: port better to OpenBSD 6.9
Paul Eggert [Sat, 2 Oct 2021 21:11:55 +0000 (14:11 -0700)]
sys_select: port better to OpenBSD 6.9

OpenBSD 6.9’s <sys/time.h> includes <sys/select.h> which then
includes <signal.h>, which caused coreutils/lib/nproc.c compiles
to fail with "/usr/include/signal.h:57: warning: 'struct
sigaction' declared inside parameter list".  Fix this.
* lib/sys_select.in.h [__OpenBSD__]: Simply delegate to the system
header if being included from <sys/time.h>.

3 years agoautoupdate
Karl Berry [Sat, 2 Oct 2021 16:28:51 +0000 (09:28 -0700)]
autoupdate

3 years agodoc: Fix outdated statement about Spanish collation.
Bruno Haible [Wed, 22 Sep 2021 21:19:22 +0000 (23:19 +0200)]
doc: Fix outdated statement about Spanish collation.

Reported by Dietmar Schindler in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00095.html>.

* doc/regex.texi (Collating Elements vs. Characters): Choose another
example of a digraph with special collation.

3 years agodoc: Don't assume that the output format is TeX-based or info.
Bruno Haible [Wed, 22 Sep 2021 21:07:24 +0000 (23:07 +0200)]
doc: Don't assume that the output format is TeX-based or info.

Reported by Dietmar Schindler in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-09/msg00095.html>.

* doc/regex.texi (Collating Elements vs. Characters): Assume a texinfo
version that groks UTF-8 encoded ISO-8859-1 characters.

3 years agoregex: sync with glibc
Paul Eggert [Tue, 21 Sep 2021 15:14:05 +0000 (08:14 -0700)]
regex: sync with glibc

* config/srclist.txt: Uncomment-out posix/regex.c and related
files, as the Gnulib versions have now been copied to glibc.
* lib/intprops.h: Remove authorship comment, as per glibc guidelines.