]> Savannah Git Hosting - gnulib.git/log
gnulib.git
3 years agoyear2038: support glibc 2.34 _TIME_BITS=64
Paul Eggert [Fri, 2 Jul 2021 02:29:57 +0000 (19:29 -0700)]
year2038: support glibc 2.34 _TIME_BITS=64

In glibc 2.34 on Linux kernels where time_t is traditionally 32-bit,
defining _FILE_OFFSET_BITS=64 and _TIME_BITS=64 makes time_t 64-bit.
Apps must define both macros.  Gnulib applications that use either
the largefile or the year2038 modules will want this behavior;
largefile because it deals with the off_t and ino_t components of
struct stat already, and so should also deal with time_t.
* NEWS, doc/largefile.texi, doc/posix-headers/time.texi:
Mention this.
* m4/largefile.m4: Override two macros even in Autoconf 2.70 and later.
(_AC_SYS_LARGEFILE_MACRO_VALUE): #undef $1 before #defining it, in
case some other Gnulib macro has #defined it.
(AC_SYS_LARGEFILE): Use AS_IF and AS_CASE to propagate AC_REQUIREs.
Invoke gl_YEAR2038_BODY if we need to set _FILE_OFFSET_BITS=64.
* m4/year2038.m4 (gl_YEAR2038_TEST_INCLUDES): New macro.
(gl_YEAR2038_BODY): New macro, with gl_YEAR2038’s old body; this
macro is designed to be used directly instead of being
AC_REQUIREd.  It takes an argument specifying whether 64-bit is
required.  Set _TIME_BITS=64 if this makes a difference in time_t
width when setting _FILE_OFFSET_BITS=64.  Do not warn about
32-bit time_t more than once.
* modules/largefile (Files): Add year2038.m4.
(Depends-on): Require gl_YEAR2038_EARLY.

3 years agorelocatable-prog-wrapper: add m4 files
Paul Eggert [Thu, 1 Jul 2021 18:26:13 +0000 (11:26 -0700)]
relocatable-prog-wrapper: add m4 files

Add .m4 files needed for standalone relocatable-prog-wrapper, so
that ‘./gnulib-tool --test relocatable-prog-wrapper’ does not fail
with diagnostics like ‘configure.ac:63: error: possibly undefined
macro: gl_FUNC_MALLOC_POSIX’.
* modules/relocatable-prog-wrapper (Files): Add m4/free.m4,
m4/malloc.m4, m4/mempcpy.m4, m4/rawmemchr.m4, m4/realloc.m4.

3 years agoautoupdate
Karl Berry [Thu, 1 Jul 2021 14:54:50 +0000 (07:54 -0700)]
autoupdate

3 years agostrerror-override: Fix possible compilation error.
Bruno Haible [Tue, 29 Jun 2021 00:17:30 +0000 (02:17 +0200)]
strerror-override: Fix possible compilation error.

Reported by Thomas Klausner <wiz@netbsd.org>.

* lib/strerror-override.h (GNULIB_defined_strerror_override_macro): New
macro.
* lib/strerror-override.c (strerror_override): Don't define if
GNULIB_defined_strerror_override_macro is set.

3 years agoenviron: Fix wrong autoconf test result in C++ mode.
Bruno Haible [Mon, 28 Jun 2021 00:30:25 +0000 (02:30 +0200)]
environ: Fix wrong autoconf test result in C++ mode.

* m4/environ.m4 (gt_CHECK_VAR_DECL): Use a typedef'ed type, not an
anonymous type.

3 years agoautoupdate
Karl Berry [Sat, 26 Jun 2021 14:42:34 +0000 (07:42 -0700)]
autoupdate

3 years agoregex: fix undefined behavior
Egor Ignatov [Tue, 22 Jun 2021 19:35:15 +0000 (12:35 -0700)]
regex: fix undefined behavior

Problem reported by Paul Eggert in:
https://lists.gnu.org/r/bug-gnulib/2021-06/msg00115.html
* lib/regexec.c (proceed_next_node):
Don’t insert already-inserted node.

2021-06-06  Egor Ignatov  <egori@altlinux.org>  (tiny change)

3 years agosigsegv, sigsegv-tests: Assign my contributions to the FSF.
Eric Blake [Mon, 21 Jun 2021 18:21:18 +0000 (13:21 -0500)]
sigsegv, sigsegv-tests: Assign my contributions to the FSF.

Following Bruno's lead, I'm also happy with this change.

* m4/sigaltstack.m4: Change copyright notice: Write "Copyright (C) FSF"
instead of "Copyright (C) Eric Blake".
* tests/altstack-util.h: Likewise.
* tests/test-sigsegv-catch-stackoverflow1.c: Likewise.
* tests/test-sigsegv-catch-stackoverflow2.c: Likewise.

3 years agounistd: Avoid compilation error in C++ mode on Solaris, HP-UX, mingw.
Bruno Haible [Sun, 20 Jun 2021 15:18:26 +0000 (17:18 +0200)]
unistd: Avoid compilation error in C++ mode on Solaris, HP-UX, mingw.

Reported by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00135.html>.

* lib/unistd.in.h (swab): Consider different declarations on Solaris,
HP-UX, and old mingw.

3 years agoSync with GNU gettext.
Bruno Haible [Sun, 20 Jun 2021 14:29:39 +0000 (16:29 +0200)]
Sync with GNU gettext.

* lib/printf-parse.c: Ignore IN_LIBINTL and IN_LIBASPRINTF.
* lib/vasnprintf.c: Ignore IN_LIBINTL.

3 years agoSync with GNU gettext.
Bruno Haible [Sun, 20 Jun 2021 01:25:53 +0000 (03:25 +0200)]
Sync with GNU gettext.

* lib/tsearch.c: Ignore IN_LIBINTL.
* lib/localename-table.h: Likewise.
* lib/localename.c: Ignore IN_LIBINTL in some places.

3 years agounistd: Improve conflict resolution between gnulib and textstyle.h.
Bruno Haible [Sun, 20 Jun 2021 01:23:45 +0000 (03:23 +0200)]
unistd: Improve conflict resolution between gnulib and textstyle.h.

* lib/unistd.in.h (GNULIB_overrides_isatty): New macro.

3 years agostdio: Improve conflict resolution between gnulib and libintl.h.
Bruno Haible [Sun, 20 Jun 2021 01:23:41 +0000 (03:23 +0200)]
stdio: Improve conflict resolution between gnulib and libintl.h.

* lib/stdio.in.h (GNULIB_overrides_snprintf, GNULIB_overrides_sprintf,
GNULIB_overrides_asprintf, GNULIB_overrides_vasprintf,
GNULIB_overrides_vsnprintf, GNULIB_overrides_vsprintf): New macros.

3 years agodeclared.sh: Allow parsing 'extern "C"' lines.
Bruno Haible [Sun, 20 Jun 2021 01:20:08 +0000 (03:20 +0200)]
declared.sh: Allow parsing 'extern "C"' lines.

* build-aux/declared.sh: Don't concatenate lines to an 'extern "C" {'
line.

3 years agounitypes: Fix trouble caused by installed older versions of unitypes.h.
Bruno Haible [Sun, 20 Jun 2021 01:14:22 +0000 (03:14 +0200)]
unitypes: Fix trouble caused by installed older versions of unitypes.h.

* modules/unitypes (configure.ac): Define _UC_RESTRICT through config.h.

3 years agosigsegv, sigsegv-tests: Assign my contributions to the FSF.
Bruno Haible [Sat, 19 Jun 2021 11:57:53 +0000 (13:57 +0200)]
sigsegv, sigsegv-tests: Assign my contributions to the FSF.

* lib/sigsegv.in.h: Change copyright notice: Write "Copyright (C) FSF"
instead of "Copyright (C) Bruno Haible".
* lib/sigsegv.c: Likewise.
* lib/stackvma.h: Likewise.
* lib/stackvma.c: Likewise.
* m4/sigaltstack.m4: Likewise.
* m4/stack-direction.m4: Likewise.
* tests/altstack-util.h: Likewise.
* tests/mmap-anon-util.h: Likewise.
* tests/test-sigsegv-catch-segv1.c: Likewise.
* tests/test-sigsegv-catch-segv2.c: Likewise.
* tests/test-sigsegv-catch-stackoverflow1.c: Likewise.
* tests/test-sigsegv-catch-stackoverflow2.c: Likewise.

3 years agoargp: Avoid possible NULL access in argp_help.
Darren Kenny [Fri, 18 Jun 2021 17:32:00 +0000 (19:32 +0200)]
argp: Avoid possible NULL access in argp_help.

Reported by Coverity. The invocation chain is:
argp_help -> _help -> fill_in_uparams -> validate_uparams.

* lib/argp-help.c (validate_uparams): Don't crash if state == NULL.

3 years agoautoupdate
Karl Berry [Wed, 16 Jun 2021 14:39:39 +0000 (07:39 -0700)]
autoupdate

3 years agotsearch: Relicense under LGPLv2+.
Bruno Haible [Wed, 16 Jun 2021 13:17:17 +0000 (15:17 +0200)]
tsearch: Relicense under LGPLv2+.

* modules/tsearch (License): Change to LGPLv2+.
* lib/tsearch.c: Update license notice.

3 years agopipe-filter-ii tests: Fix long-standing failure on native Windows.
Bruno Haible [Tue, 15 Jun 2021 16:37:18 +0000 (18:37 +0200)]
pipe-filter-ii tests: Fix long-standing failure on native Windows.

* tests/test-pipe-filter-ii2-main.c: Include binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
* tests/test-pipe-filter-ii2-child.c: Include <unistd.h>, binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.

3 years agoautoupdate
Karl Berry [Tue, 15 Jun 2021 15:20:47 +0000 (08:20 -0700)]
autoupdate

3 years agoxnanosleep: Improve module description.
Bruno Haible [Tue, 15 Jun 2021 11:14:58 +0000 (13:14 +0200)]
xnanosleep: Improve module description.

* modules/xnanosleep (Description): Improve.
* lib/xnanosleep.h: Add comment. Make includable from C++.
* lib/xnanosleep.c: Update comment.

3 years agoxfreopen: Improve module description.
Bruno Haible [Tue, 15 Jun 2021 11:07:51 +0000 (13:07 +0200)]
xfreopen: Improve module description.

* modules/xfreopen (Description): Improve.
* lib/xfreopen.h: Add comments. Make includable from C++.
* lib/xfreopen.c: Update comment.

3 years agoidx: new printf/scanf length modifier macro
Paul Eggert [Mon, 14 Jun 2021 23:46:34 +0000 (16:46 -0700)]
idx: new printf/scanf length modifier macro

* lib/idx.h (pIDX): New macro.

3 years agoAlign 2011-11-26 patch to 2021-04-11 patch (regression from 2021-04-11).
Bruno Haible [Sun, 13 Jun 2021 20:31:03 +0000 (22:31 +0200)]
Align 2011-11-26 patch to 2021-04-11 patch (regression from 2021-04-11).

Reported by Paul Eggert.

* m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Also initialize
GNULIB_UNISTD_H_GETOPT variable.
* modules/getopt-posix (configure.ac): Set GNULIB_UNISTD_H_GETOPT
variable.
* modules/unistd (Makefile.am): Rely on ${gl_include_guard_prefix}
processing done by gnulib-tool since 2021-04-11.
* gnulib-tool: Revert last change.
* pygnulib/GLEmiter.py: Likewise.

3 years ago* lib/stack.h: Omit stray semicolon.
Paul Eggert [Sun, 13 Jun 2021 17:44:50 +0000 (10:44 -0700)]
* lib/stack.h: Omit stray semicolon.

3 years agogetopt-gnu: port back to Solaris 10
Paul Eggert [Sun, 13 Jun 2021 17:31:33 +0000 (10:31 -0700)]
getopt-gnu: port back to Solaris 10

* gnulib-tool (func_emit_lib_Makefile_am)
(func_emit_tests_Makefile_am): Don’t substitute things like
$(GNULIB_${gl_include_guard_prefix}_UNISTD_H_GETOPT),
as this mishandles unistd and getopt-gnu, which breaks
‘make check’ on Solaris 10 with getopt-gnu.
* pygnulib/GLEmiter.py (lib_Makefile_am, tests_Makefile_am):
Likewise, albeit hackier since I did not test this and
so went with a trivial hack instead.

3 years agoialloc: Put appropriate license notice in source files.
Bruno Haible [Sun, 13 Jun 2021 10:02:08 +0000 (12:02 +0200)]
ialloc: Put appropriate license notice in source files.

* lib/ialloc.h: Use LGPLv3+ notice.
* lib/ialloc.c: Likewise.

3 years ago* lib/xmalloc.c (nonnull): Pacify gcc -Wsuggest-attribute=pure (GCC 10.3).
Paul Eggert [Sat, 12 Jun 2021 00:37:32 +0000 (17:37 -0700)]
* lib/xmalloc.c (nonnull): Pacify gcc -Wsuggest-attribute=pure (GCC 10.3).

3 years agoxgethostname: prefer idx_t for indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:58 +0000 (17:18 -0700)]
xgethostname: prefer idx_t for indexes

* lib/xgethostname.c (XGETANAME):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.

3 years agouserspec: prefer idx_t for indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:58 +0000 (17:18 -0700)]
userspec: prefer idx_t for indexes

* lib/userspec.c (parse_with_separator):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.

3 years agostack: prefer idx_t for indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:58 +0000 (17:18 -0700)]
stack: prefer idx_t for indexes

* lib/stack.h (_GL_STACK_TYPE, _GL_STACK_PREFIX):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.

3 years agosavedir: prefer idx_t for indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
savedir: prefer idx_t for indexes

* lib/savedir.c (streamsavedir):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.

3 years agoreadutmp: prefer idx_t for indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
readutmp: prefer idx_t for indexes

* lib/readutmp.c (read_utmp):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.

3 years agoreadtokens: prefer idx_t for indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
readtokens: prefer idx_t for indexes

* lib/readtokens.c (readtoken, readtokens):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.

3 years agolinebuffer: prefer idx_t for indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
linebuffer: prefer idx_t for indexes

* lib/linebuffer.c (readlinebuffer_delim):
* lib/linebuffer.h (struct linebuffer):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.
* lib/linebuffer.h: Include idx.h.
* modules/linebuffer (Depends-on): Add idx.

3 years agogetusershell: prefer idx_t for indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
getusershell: prefer idx_t for indexes

* lib/getusershell.c (line_size, readname):
Prefer idx_t to size_t for indexes, using idx_t-related allocators.

3 years agoexclude: prefer idx_t for most indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
exclude: prefer idx_t for most indexes

* lib/exclude.c (struct exclude_pattern, free_exclude_segment)
(file_pattern_matches, add_exclude, add_exclude_fp):
Prefer idx_t to size_t for indexes, and use idx_t-related allocators.

3 years agodfa: prefer idx_t for indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
dfa: prefer idx_t for indexes

* lib/dfa.c (mbs_to_wchar, state_index, dfaoptimize, dfaanalyze)
(icatalloc, enlist, allocmust, dfamust):
Prefer idx_t to size_t for indexes, and use idx_t-related allocators.

3 years agodirname: prefer idx_t for some indexes
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
dirname: prefer idx_t for some indexes

* lib/basename.c (base_name):
Prefer idx_t to size_t for indexes, and use idx_t-related allocators.
* lib/basename.c: Do not include xstrndup.h.
(basename): Simplify by always using memcpy.
* modules/dirname (Depends-on): Removbe xstrndup.

3 years agoxalloc: new idx_t-based allocators
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
xalloc: new idx_t-based allocators

This is for code that prefers to use idx_t for sizes.
* lib/xalloc.h (ximalloc, xizalloc, xicalloc, xirealloc)
(xireallocarray, ximemdup, ximemdup0) [GNULIB_XALLOC]:
New decls.
(x2nrealloc): Now just a decl, as the body is moved into xmalloc.c.
* lib/xmalloc.c: Include ialloc.h.
Rename some local parameters to be consistent with the .h files.
(nonnull): New static function.
(xmalloc, xcalloc): Simplify by using nonnull.
(ximalloc, xirealloc, xireallocarray, xizalloc, xicalloc)
(ximemdup, ximemdup0): New functions.
(x2nrealloc): Moved here from xalloc.h.
* modules/xalloc (Depends-on): Add ialloc.

3 years agoialloc: new module
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
ialloc: new module

* lib/ialloc.c, lib/ialloc.h, modules/ialloc: New files.

3 years agoexclude: improve wide-character hashing
Paul Eggert [Sat, 12 Jun 2021 00:18:57 +0000 (17:18 -0700)]
exclude: improve wide-character hashing

* lib/exclude.c (string_hasher_ci): Take the modulo at the end
rather than each time a wide character is retrieved; this should
be more efficient and should hash better.

3 years agoMake message in last commit more precise.
Bruno Haible [Fri, 11 Jun 2021 13:55:33 +0000 (15:55 +0200)]
Make message in last commit more precise.

Suggested by Eric Blake.

* gnulib-tool (func_emit_tests_Makefile_am): Add more precision to
'check-notice' message.

3 years agoClarify where to report test failures from Gnulib tests.
Bruno Haible [Thu, 10 Jun 2021 19:43:59 +0000 (21:43 +0200)]
Clarify where to report test failures from Gnulib tests.

* gnulib-tool (func_emit_tests_Makefile_am): Emit a dependency of
'check-am' on 'check-notice' that prints a notice.

3 years agoClarify that compiler warnings in the Gnulib tests can be ignored.
Bruno Haible [Thu, 10 Jun 2021 19:26:53 +0000 (21:26 +0200)]
Clarify that compiler warnings in the Gnulib tests can be ignored.

* gnulib-tool (func_emit_tests_Makefile_am): Emit overrides for CFLAGS
and CXXFLAGS. Emit a dependency of 'all' on 'all-notice' that prints a
notice.
(func_emit_initmacro_start): Add a second argument. If it is true, emit
code to require gl_CC_ALLOW_WARNINGS and gl_CXX_ALLOW_WARNINGS.
(func_import, func_create_testdir): All callers updated.
* m4/gnulib-common.m4 (gl_CC_ALLOW_WARNINGS, gl_CXX_ALLOW_WARNINGS): New
macros.

3 years agosigsegv tests: Hide a null pointer from the compiler's optimizations.
Bruno Haible [Wed, 9 Jun 2021 19:34:22 +0000 (21:34 +0200)]
sigsegv tests: Hide a null pointer from the compiler's optimizations.

Patch by Paul Eggert.

* tests/test-sigsegv-catch-stackoverflow2.c
(null_pointer_to_volatile_int): New variable.
(main): Use it.

3 years agoget_ppid_of: Add support for DragonFly BSD.
Bruno Haible [Tue, 8 Jun 2021 01:40:26 +0000 (03:40 +0200)]
get_ppid_of: Add support for DragonFly BSD.

* lib/get_ppid_of.c: Treat DragonFly BSD like FreeBSD.

3 years agosigsegv: Document context type for DragonFly BSD.
Bruno Haible [Tue, 8 Jun 2021 01:22:22 +0000 (03:22 +0200)]
sigsegv: Document context type for DragonFly BSD.

* lib/sigsegv.in.h (stackoverflow_context_t): On DragonFly BSD, it is a
pointer to 'struct sigcontext'.

3 years agodynarray, scratch_buffer: Fix VPATH builds (regression from yesterday).
Bruno Haible [Tue, 8 Jun 2021 00:32:41 +0000 (02:32 +0200)]
dynarray, scratch_buffer: Fix VPATH builds (regression from yesterday).

* modules/dynarray (configure.ac): Invoke AC_PROG_MKDIR_P.
(Makefile.am): Create malloc/ directory before creating
malloc/dynarray.gl.h and malloc/dynarray-skeleton.gl.h.
* modules/scratch_buffer (configure.ac): Invoke AC_PROG_MKDIR_P.
(Makefile.am): Create malloc/ directory before creating
malloc/scratch_buffer.gl.h.

3 years agoptsname_r: Add support for DragonFly BSD 6.0.
Bruno Haible [Mon, 7 Jun 2021 23:27:08 +0000 (01:27 +0200)]
ptsname_r: Add support for DragonFly BSD 6.0.

* lib/ptsname_r.c (__ptsname_r): Add implementation for DragonFly BSD.
* tests/test-ptsname_r.c (main): Treat Dragonfly BSD like Solaris.

3 years agoAvoid some test failures on DragonFly BSD 6.0.
Bruno Haible [Mon, 7 Jun 2021 23:17:02 +0000 (01:17 +0200)]
Avoid some test failures on DragonFly BSD 6.0.

* tests/test-c32isalnum.c (main): On Dragonfly BSD, disable tests that
fail.
* tests/test-c32isalpha.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isupper.c (main): Likewise.
* tests/test-ptsname.c (main): Treat Dragonfly BSD like Solaris.

3 years agomountlist: recognize fuse.portal as dummy file system
Kamil Dudka [Mon, 7 Jun 2021 12:43:03 +0000 (14:43 +0200)]
mountlist: recognize fuse.portal as dummy file system

This was originally proposed at:

    https://lists.gnu.org/archive/html/bug-gnulib/2021-02/msg00053.html

As the full review might take some time, would it be possible to apply
at least the part related to fuse.portal file systems?  They started to
cause problems recently:

    https://bugs.launchpad.net/ubuntu/+source/xdg-desktop-portal/+bug/1905623
    https://github.com/muesli/duf/issues/35
    https://bugzilla.redhat.com/1913358

3 years agohost-os: Add support for DragonFly BSD.
Bruno Haible [Mon, 7 Jun 2021 21:46:15 +0000 (23:46 +0200)]
host-os: Add support for DragonFly BSD.

* m4/host-os.m4 (gl_HOST_OS): On DragonFly BSD, set
HOST_OPERATING_SYSTEM to "DragonFly BSD", not "Dragonfly".

3 years agothread: Fix test link error on DragonFly BSD 6.0.
Bruno Haible [Mon, 7 Jun 2021 19:26:31 +0000 (21:26 +0200)]
thread: Fix test link error on DragonFly BSD 6.0.

* lib/glthread/thread.c (gl_thread_create): Moved to here...
* lib/glthread/thread.h (gl_thread_create): ...from here.
(_GLTHREAD_THREAD_INLINE): Remove macro.
Remove _GL_INLINE_HEADER_BEGIN/END invocations.

3 years agosigsegv: Avoid a gcc warning "declaration of 'sig' shadows a parameter".
Bruno Haible [Mon, 7 Jun 2021 02:24:50 +0000 (04:24 +0200)]
sigsegv: Avoid a gcc warning "declaration of 'sig' shadows a parameter".

Reported by Dmitry V. Levin <ldv@altlinux.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-06/msg00018.html>.

* lib/sigsegv.c (sigsegv_handler): Use a different local variable name
than 'sig'.

3 years agoFix comments.
Bruno Haible [Sun, 6 Jun 2021 23:19:05 +0000 (01:19 +0200)]
Fix comments.

3 years agoscratch_buffer: Avoid conflict with prepr. macros owned by the system.
Bruno Haible [Sun, 6 Jun 2021 22:56:50 +0000 (00:56 +0200)]
scratch_buffer: Avoid conflict with prepr. macros owned by the system.

* lib/scratch_buffer.h: Don't include <libc-config.h>. Define
_GL_LIKELY, _GL_UNLIKELY. Include malloc/scratch_buffer.gl.h instead of
malloc/scratch_buffer.h.
* modules/scratch_buffer (Depends-on): Add builtin-expect.
(Makefile.am): Arrange to create malloc/scratch_buffer.gl.h from
malloc/scratch_buffer.h.

3 years agodynarray: Avoid conflict with preprocessor macros owned by the system.
Bruno Haible [Sun, 6 Jun 2021 22:54:25 +0000 (00:54 +0200)]
dynarray: Avoid conflict with preprocessor macros owned by the system.

* lib/dynarray.h: Don't include <libc-config.h>. Define _GL_LIKELY,
_GL_UNLIKELY. Include malloc/dynarray.gl.h instead of malloc/dynarray.h.
Include malloc/dynarray-skeleton.gl.h instead of
malloc/dynarray-skeleton.c.
* modules/dynarray (Depends-on): Add builtin-expect.
(Makefile.am): Arrange to create malloc/dynarray.gl.h from
malloc/dynarray.h and malloc/dynarray-skeleton.gl.h from
malloc/dynarray-skeleton.c.

3 years agoglob-h: Make last patch work with Solaris 10 cc.
Bruno Haible [Sun, 6 Jun 2021 23:18:01 +0000 (01:18 +0200)]
glob-h: Make last patch work with Solaris 10 cc.

* modules/glob-h (Makefile.am): Also transform the '__restrict' macro.

3 years agoglob-h: Avoid conflict with preprocessor macros owned by the system.
Bruno Haible [Sun, 6 Jun 2021 22:34:54 +0000 (00:34 +0200)]
glob-h: Avoid conflict with preprocessor macros owned by the system.

This fixes a compilation error on DragonFly BSD 6.0.

* lib/glob.in.h: Don't include <libc-config.h>. Don't define __USE_GNU.
Include glob-libc.gl.h instead of glob-libc.h.
* modules/glob-h (Makefile.am): Arrange to create glob-libc.gl.h from
glob-libc.h.
* lib/libc-config.h: Add comment.

3 years agoChangeLog: add entries for the last three commits
Dmitry V. Levin [Sun, 6 Jun 2021 08:00:00 +0000 (08:00 +0000)]
ChangeLog: add entries for the last three commits

3 years agoregex-tests: test for regressions fixed by the previous commit
Dmitry V. Levin [Sun, 6 Jun 2021 08:00:00 +0000 (08:00 +0000)]
regex-tests: test for regressions fixed by the previous commit

* tests/test-regex.c (tests): Add test cases for *+ and ** regressions
fixed by the previous commit.

Link: https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00134.html
3 years agoregex: fix match with possessive quantifier
Egor Ignatov [Wed, 26 May 2021 09:08:19 +0000 (12:08 +0300)]
regex: fix match with possessive quantifier

Fix behaviour introduced in 70b673eb7, where regexps with
possessive quantifier("*+") didn't match.

* lib/regexec.c (set_regs): Pop if CUR_NODE has already been checked
only when we have a fail stack.

Fixes: 70b673eb7 ("regex: fix longstanding backref match bug")
Signed-off-by: Egor Ignatov <egori@altlinux.org>
3 years agoregex-tests: remove incorrect comment
Dmitry V. Levin [Sun, 6 Jun 2021 08:00:00 +0000 (08:00 +0000)]
regex-tests: remove incorrect comment

* tests/test-regex.c (tests): Remove the comment saying that some tests
are not used.  That comment was copied along with tests from glibc
where some of these tests are commented out.

Fixes: 70b673eb7 ("regex: fix longstanding backref match bug")
3 years agolib-symbol-visibility: Make configure check work for newer GCC.
Bruno Haible [Sat, 5 Jun 2021 15:07:06 +0000 (17:07 +0200)]
lib-symbol-visibility: Make configure check work for newer GCC.

Reported by Ozkan Sezer <sezeroz@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-05/msg00117.html>.

* m4/visibility.m4 (gl_VISIBILITY): Add a function definition for each
declaration in the test program.

3 years agovasnprintf: Don't leak memory when memory allocation fails.
Bruno Haible [Sat, 5 Jun 2021 13:44:26 +0000 (15:44 +0200)]
vasnprintf: Don't leak memory when memory allocation fails.

Found by Coverity. Reported by Mike Fabian <mfabian@redhat.com> in
<https://lists.gnu.org/archive/html/bug-libunistring/2021-06/msg00000.html>.

* lib/vasnprintf.c (VASNPRINTF): In places where a local variable points
to heap-allocated storage, free that storage before doing
'goto out_of_memory;'.

3 years agognulib-tool: Stop doing license notice replacements.
Bruno Haible [Fri, 4 Jun 2021 20:27:10 +0000 (22:27 +0200)]
gnulib-tool: Stop doing license notice replacements.

* gnulib-tool: Don't document --more-symlinks and --more-hardlinks any
more.
(do_copyrights): Remove variable.
(func_import): Don't perform license updates on imported files any more.
* pygnulib/GLInfo.py: Don't document --more-symlinks any more.
* doc/gnulib-intro.texi (Copyright): Document the new situation.
* doc/gnulib.texi (Module description): Likewise.
* NEWS: Mention the change.

3 years agogit-merge-changelog: Fix license.
Bruno Haible [Fri, 4 Jun 2021 20:13:43 +0000 (22:13 +0200)]
git-merge-changelog: Fix license.

* modules/git-merge-changelog (License): Change back to GPL.
* lib/git-merge-changelog.c: Use a GPLv3+ notice.

3 years agoPut GPLv3+ notices in source files where appropriate.
Bruno Haible [Fri, 4 Jun 2021 18:55:56 +0000 (20:55 +0200)]
Put GPLv3+ notices in source files where appropriate.

* lib/*.{h,c}: Use GPLv3+ notice whenever the module description says
so.
* build-aux/pmccabe.css: Likewise.

3 years agoPut LGPLv3+ notices in source files where appropriate.
Bruno Haible [Fri, 4 Jun 2021 18:55:53 +0000 (20:55 +0200)]
Put LGPLv3+ notices in source files where appropriate.

* lib/**.{h,c}: Use LGPLv3+ notice whenever the module description says
so.

3 years agoPut "LGPLv3+ or GPLv2+" notices in source files where appropriate.
Bruno Haible [Fri, 4 Jun 2021 18:55:49 +0000 (20:55 +0200)]
Put "LGPLv3+ or GPLv2+" notices in source files where appropriate.

* lib/**.{h,c,gperf}: Use "LGPLv3+ or GPLv2+" notice whenever the module
description says so.

3 years agoGenerate correct license notices in libunistring files.
Bruno Haible [Fri, 4 Jun 2021 18:55:46 +0000 (20:55 +0200)]
Generate correct license notices in libunistring files.

* lib/gen-uni-tables.c (output_library_license, output_tests_license):
New functions.
(output_predicate, output_category, output_combclass,
output_bidi_category, output_decimal_digit, output_digit,
output_numeric, output_mirror, output_joining_type,
output_joining_group, output_scripts, output_scripts_byname,
output_blocks, output_ident_category, output_lbrk_tables,
output_wbrk_tables, output_gbp_table, output_decomposition_tables,
output_composition_tables, output_simple_mapping, output_casing_rules):
Invoke output_library_license.
(output_predicate_test, output_decimal_digit_test, output_digit_test,
output_numeric_test, output_joining_type_test,
output_joining_group_test, output_gbp_test, output_simple_mapping_test):
Invoke output_tests_license.
* lib/uni*/*.h, lib/uni*/*.gperf: Regenerated.
* tests/uni*/*.h: Likewise.

3 years agoGenerate correct license notices in libunistring files.
Bruno Haible [Fri, 4 Jun 2021 18:55:44 +0000 (20:55 +0200)]
Generate correct license notices in libunistring files.

* lib/uniname/gen-uninames.lisp (main): Emit a copyright and license
notice.
* lib/uniname/uninames.h: Regenerated.

3 years agoPut LGPLv2+ notices in source files where appropriate.
Bruno Haible [Fri, 4 Jun 2021 18:55:41 +0000 (20:55 +0200)]
Put LGPLv2+ notices in source files where appropriate.

* lib/**.{h,c,gperf}: Use LGPLv2+ notice whenever the module description
says so.

3 years agoPut "unlimited" notices in source files where appropriate.
Bruno Haible [Fri, 4 Jun 2021 18:55:39 +0000 (20:55 +0200)]
Put "unlimited" notices in source files where appropriate.

* build-aux/prefix-gnulib-mk: Use "unlimited" notice, since the module
description says so.

3 years agoPut public domain notices in source files where appropriate.
Bruno Haible [Fri, 4 Jun 2021 18:55:35 +0000 (20:55 +0200)]
Put public domain notices in source files where appropriate.

* lib/{alloca.c,atexit.c,memmove.c}: Use public domain notice.

3 years agoRevamp check-copyright script.
Bruno Haible [Fri, 4 Jun 2021 18:49:16 +0000 (20:49 +0200)]
Revamp check-copyright script.

* check-copyright: Search only the first 50 lines of each file.
Recognize 'LGPLv3+ or GPLv2+', 'unlimited', and 'public domain' license
notices. For files that are part of several modules, consider the
weakest among the licenses. Allocate more room for the first output
column.

3 years agognupload, git-merge-changelog: Fix module description.
Bruno Haible [Fri, 4 Jun 2021 18:42:44 +0000 (20:42 +0200)]
gnupload, git-merge-changelog: Fix module description.

* gnulib-tool (func_import, func_create_testdir): Treat
'GPLv2+ build tool' like 'GPLed build tool'.
* pygnulib/GLImport.py (prepare): Likewise.
* modules/gnupload (License): Change to 'GPLv2+ build tool'.
* modules/git-merge-changelog (License): Change to GPLv2+.

3 years agoNew directory with license notices.
Bruno Haible [Fri, 4 Jun 2021 18:03:22 +0000 (20:03 +0200)]
New directory with license notices.

* etc/license-notices/*: New files.

3 years agoreallocarray-tests: port to weird platforms
Paul Eggert [Sun, 30 May 2021 17:04:06 +0000 (10:04 -0700)]
reallocarray-tests: port to weird platforms

* tests/test-reallocarray.c (main): Don’t assume that
PTRDIFF_MAX / 2 + 1 <= SIZE_MAX.  POSIX allows platforms
where this isn’t true, though I don’t know of any examples.

3 years agodfa, etc.: prefer xreallocarray to older name
Paul Eggert [Sun, 30 May 2021 17:02:20 +0000 (10:02 -0700)]
dfa, etc.: prefer xreallocarray to older name

* lib/dfa.c (addtok_mb, realloc_trans_if_necessary, enlist):
* lib/readtokens.c (readtokens):
* tests/uninorm/test-u32-normalize-big.c:
(read_normalization_test_file):
Prefer xreallocarray to the equivalent xnrealloc.
The newer name follows the glibc lead of ‘reallocarray’.

3 years agoWrite 'LGPLv3+ or GPLv2+' instead of 'LGPLv3+ or GPLv2'.
Bruno Haible [Sun, 30 May 2021 12:37:06 +0000 (14:37 +0200)]
Write 'LGPLv3+ or GPLv2+' instead of 'LGPLv3+ or GPLv2'.

* modules/* (License): Change.
* gnulib-tool (func_import, func_create_testdir): Likewise.

3 years ago* stackvma.c: Fix misspelled comment.
Paul Eggert [Sat, 29 May 2021 17:19:30 +0000 (10:19 -0700)]
* stackvma.c: Fix misspelled comment.

3 years agosigsegv: Port to Solaris 11
Paul Eggert [Sat, 29 May 2021 17:14:01 +0000 (10:14 -0700)]
sigsegv: Port to Solaris 11

Problem reported by Kiyoshi KANAZAWA in:
https://lists.gnu.org/r/bug-m4/2021-05/msg00020.html
* lib/stackvma.c (_FILE_OFFSET_BITS): #undef on Solaris and Android.

3 years agoautoupdate
Karl Berry [Tue, 25 May 2021 22:05:09 +0000 (15:05 -0700)]
autoupdate

3 years agoc-stack: Document another restriction.
Bruno Haible [Mon, 24 May 2021 10:32:25 +0000 (12:32 +0200)]
c-stack: Document another restriction.

Triggered by a discussion with Paul Eggert.

* lib/c-stack.h: Mention that ACTION should not use nested functions.

3 years agostdio: Fix compilation error on DragonFly BSD.
Bruno Haible [Sat, 22 May 2021 20:14:28 +0000 (22:14 +0200)]
stdio: Fix compilation error on DragonFly BSD.

* lib/stdio.in.h (fcloseall): Treat DragonFly BSD like FreeBSD.

3 years agogetprogname: port to Tru64
Larkin Nickle [Sat, 22 May 2021 19:17:50 +0000 (12:17 -0700)]
getprogname: port to Tru64

* lib/getprogname.c: Treat __osf__ like __sgi, except
with /proc/123 instead of /proc/pinfo/123.

3 years agosigsegv: don’t assume SIGSTKSZ is a constant
Paul Eggert [Fri, 21 May 2021 21:41:42 +0000 (14:41 -0700)]
sigsegv: don’t assume SIGSTKSZ is a constant

* m4/sigaltstack.m4 (SV_SIGALTSTACK): Don’t attempt to override
SIGSTKSZ.  Instead, use an array that is plenty large, while
checking that it’s large enough.  Also, be consistent about
putting that array in static storage rather than on the stack.
* tests/altstack-util.h (SIGSTKSZ): Don’t define.
(MYSTACK_SIZE): New macro, used consistently instead of SIGSTKSZ.
(mystack_storage, mystack): Now static.
(prepare_alternate_stack) [defined SIGSTKSZ]:
Check that MYSTACK_SIZE is large enough.

3 years agofstatat: doc improvement
Paul Eggert [Thu, 20 May 2021 18:24:52 +0000 (11:24 -0700)]
fstatat: doc improvement

* doc/posix-functions/fstatat.texi (fstatat):
Mention AT_EMPTY_PATH when talking about empty strings.

3 years agoc-stack: Support catching stack overflow on most platforms without libsigsegv.
Bruno Haible [Mon, 17 May 2021 01:36:35 +0000 (03:36 +0200)]
c-stack: Support catching stack overflow on most platforms without libsigsegv.

* lib/c-stack.c: Remove all Solaris-specific code. Include <sigsegv.h>
always.
* m4/c-stack.m4: Remove all Solaris-specific code.
(gl_C_STACK): Test $with_libsigsegv from module 'sigsegv'.
* modules/c-stack (Files): Remove m4/libsigsegv.m4.
(Depends-on): Add sigsegv. Remove havelib, intprops, inttypes, mempcpy,
sigaction, stdbool.

3 years agosigsegv, c-stack: Avoid compilation error with glibc >= 2.34.
Bruno Haible [Mon, 17 May 2021 00:13:12 +0000 (02:13 +0200)]
sigsegv, c-stack: Avoid compilation error with glibc >= 2.34.

* lib/sigsegv.in.h (SIGSTKSZ): On glibc systems, redefine to a suitable
constant.
* m4/sigaltstack.m4 (SV_SIGALTSTACK): Likewise.
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Likewise.

3 years agosigsegv: Add tests.
Bruno Haible [Sun, 16 May 2021 16:29:48 +0000 (18:29 +0200)]
sigsegv: Add tests.

* tests/test-sigsegv-catch-segv1.c: New file, from GNU libsigsegv with
modifications.
* tests/test-sigsegv-catch-segv2.c: Likewise.
* tests/test-sigsegv-catch-stackoverflow1.c: Likewise.
* tests/test-sigsegv-catch-stackoverflow2.c: Likewise.
* tests/altstack-util.h: Likewise.
* tests/mmap-anon-util.h: Likewise.
* modules/sigsegv-tests: New file.

3 years agosigsegv: New module.
Bruno Haible [Sun, 16 May 2021 13:20:12 +0000 (15:20 +0200)]
sigsegv: New module.

* lib/sigsegv.in.h: New file, from GNU libsigsegv with modifications.
* lib/sigsegv.c: Likewise.
* lib/stackvma.h: Likewise.
* lib/stackvma.c: Likewise.
* m4/sigaltstack.m4: Likewise.
* m4/stack-direction.m4: Likewise.
* modules/sigsegv: New file.

3 years agorealloc-gnu: avoid glibc MALLOC_CHECK_ issue
Pádraig Brady [Sat, 15 May 2021 16:50:33 +0000 (17:50 +0100)]
realloc-gnu: avoid glibc MALLOC_CHECK_ issue

* tests/test-realloc-gnu.c (main): if MALLOC_CHECK_ env var
is set then don't check ENOMEM is returned from realloc().
See https://sourceware.org/bugzilla/show_bug.cgi?id=27870
Note it doesn't suffice to unsetenv() this var within the program,
as the hooks have already been set up at that stage.

3 years agoc-stack: work around Solaris 11 bugs
Paul Eggert [Sat, 15 May 2021 05:48:20 +0000 (22:48 -0700)]
c-stack: work around Solaris 11 bugs

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2021-05/msg00062.html
* lib/c-stack.c: Always include sigsegv.h if HAVE_LIBSIGSEGV.
(USE_LIBSIGSEGV): Do not use libsigsegv if the kernel
has the si_addr bug and libsigsegv is too old to work
around it.
(segv_handler) [!USE_LIBSIGSEGV]: Do not trust si_addr
if BOGUS_SI_ADDR_UPON_STACK_OVERFLOW.
* m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC):
Define BOGUS_SI_ADDR_UPON_STACK_OVERFLOW on Solaris 2.11 SPARC.
And do not define HAVE_XSI_STACK_OVERFLOW_HEURISTIC.

3 years agofcntl tests: Avoid failure in MacPorts.
Bruno Haible [Fri, 14 May 2021 21:50:52 +0000 (23:50 +0200)]
fcntl tests: Avoid failure in MacPorts.

Reported by Nicholas Gaya <nicholasgaya@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-05/msg00014.html>.

* tests/test-fcntl.c (main): Close fd 10 before assuming that it is
closed.
* tests/test-execute-main.c: Update comment.

3 years agolinked-list-unportable-test: New module.
Bruno Haible [Fri, 14 May 2021 21:32:08 +0000 (23:32 +0200)]
linked-list-unportable-test: New module.

* modules/linked-list-unportable-tests: New file, based on
modules/linked-list-tests.
* modules/linked-list-tests: Remove the unportable tests from here.
Depend on linked-list-unportable-tests.

3 years agovalgrind-tests: Doc fix and introduce AM_VALGRINDFLAGS.
Simon Josefsson [Fri, 14 May 2021 17:23:23 +0000 (19:23 +0200)]
valgrind-tests: Doc fix and introduce AM_VALGRINDFLAGS.

* doc/valgrind-tests.texi (Using valgrind automatically): Clarify
when the parallel vs serial test harness is used, suggested by
Bruno Haible <bruno@clisp.org>.
* m4/valgrind-tests.m4: Add VALGRIND_PROGRAM and AM_VALGRINDFLAGS.