]> Savannah Git Hosting - gnulib.git/log
gnulib.git
3 years agoargmatch-tests: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:52:29 +0000 (17:52 -0700)]
argmatch-tests: improve -fanalyzer malloc checking

3 years agovasnprintf: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:51:11 +0000 (17:51 -0700)]
vasnprintf: improve -fanalyzer malloc checking

3 years agoxvasprintf: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:48:29 +0000 (17:48 -0700)]
xvasprintf: improve -fanalyzer malloc checking

3 years agoxstriconv: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:47:24 +0000 (17:47 -0700)]
xstriconv: improve -fanalyzer malloc checking

3 years agoxreadlink: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:46:47 +0000 (17:46 -0700)]
xreadlink: improve -fanalyzer malloc checking

3 years agoxmalloca: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:46:13 +0000 (17:46 -0700)]
xmalloca: improve -fanalyzer malloc checking

3 years agoxgethostname: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:45:24 +0000 (17:45 -0700)]
xgethostname: improve -fanalyzer malloc checking

3 years agoxgetcwd: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:44:46 +0000 (17:44 -0700)]
xgetcwd: improve -fanalyzer malloc checking

3 years agotrim: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:44:05 +0000 (17:44 -0700)]
trim: improve -fanalyzer malloc checking

3 years agosystem-quote: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:43:35 +0000 (17:43 -0700)]
system-quote: improve -fanalyzer malloc checking

3 years agosh-quote: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:42:56 +0000 (17:42 -0700)]
sh-quote: improve -fanalyzer malloc checking

3 years agosavedir: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:41:59 +0000 (17:41 -0700)]
savedir: improve -fanalyzer malloc checking

3 years agoreadutmp: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:40:30 +0000 (17:40 -0700)]
readutmp: improve -fanalyzer malloc checking

3 years agoquotearg: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:39:38 +0000 (17:39 -0700)]
quotearg: improve -fanalyzer malloc checking

3 years agopagalign_alloc: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:38:29 +0000 (17:38 -0700)]
pagalign_alloc: improve -fanalyzer malloc checking

3 years agomountlist: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:37:11 +0000 (17:37 -0700)]
mountlist: improve -fanalyzer malloc checking

3 years agomodechange: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:36:09 +0000 (17:36 -0700)]
modechange: improve -fanalyzer malloc checking

3 years agomalloca: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:35:17 +0000 (17:35 -0700)]
malloca: improve -fanalyzer malloc checking

3 years agofilenamecat-lgpl: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:31:38 +0000 (17:31 -0700)]
filenamecat-lgpl: improve -fanalyzer malloc checking

3 years agoexclude: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:30:17 +0000 (17:30 -0700)]
exclude: improve -fanalyzer malloc checking

3 years agodirname: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:29:26 +0000 (17:29 -0700)]
dirname: improve -fanalyzer malloc checking

3 years agodfa: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:28:01 +0000 (17:28 -0700)]
dfa: improve -fanalyzer malloc checking

3 years agomaint: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:24:52 +0000 (17:24 -0700)]
maint: improve -fanalyzer malloc checking

* lib/canonicalize.h:

3 years agobackupfile: improve -fanalyzer malloc checking
Paul Eggert [Mon, 2 Aug 2021 00:23:48 +0000 (17:23 -0700)]
backupfile: improve -fanalyzer malloc checking

* lib/backup-internal.h, lib/backupfile.h:
Add malloc-related attributes and include stdlib.h as needed.

3 years agoregex: pacify GCC 11.2.1's -fanalyzer
Jim Meyering [Sun, 1 Aug 2021 19:26:49 +0000 (12:26 -0700)]
regex: pacify GCC 11.2.1's -fanalyzer

* lib/regex_internal.c (re_node_set_merge):
Add a debug assertion to pacify GCC 11.2.1's -fanalyzer.

3 years agolimits-h tests: Add tests for BOOL_MAX and BOOL_WIDTH.
Bruno Haible [Sun, 1 Aug 2021 13:38:04 +0000 (15:38 +0200)]
limits-h tests: Add tests for BOOL_MAX and BOOL_WIDTH.

* tests/test-limits-h.c (bool_attrs): New variable.
Check value of BOOL_MAX.

3 years agoregex: pacify GCC 11.2 -fanalyzer
Paul Eggert [Sat, 31 Jul 2021 20:32:02 +0000 (13:32 -0700)]
regex: pacify GCC 11.2 -fanalyzer

* lib/regex_internal.c (re_node_set_insert):
Add a debug assertion to pacify GCC 11.2 -fanalyzer.

3 years agomaint: pacify GCC 11.2 -fanalyzer in crypto tests
Paul Eggert [Sat, 31 Jul 2021 19:58:51 +0000 (12:58 -0700)]
maint: pacify GCC 11.2 -fanalyzer in crypto tests

* tests/bench-digest.h (main): Report an error after memory
exhaustion, instead of using a null pointer.

3 years agodoc: C2X -> C2x
Paul Eggert [Sat, 31 Jul 2021 18:59:55 +0000 (11:59 -0700)]
doc: C2X -> C2x

3 years agoxalloc: add malloc-related function attributes
Paul Eggert [Fri, 30 Jul 2021 19:56:24 +0000 (12:56 -0700)]
xalloc: add malloc-related function attributes

* lib/quotearg.h, lib/xalloc.h: Include stdlib.h, for
the benefit of _GL_ATTRIBUTE_DALLOC_FREE.
* lib/quotearg.h (clone_quoting_options):
* lib/xalloc.h (xmalloc, ximalloc, xzalloc, xizalloc, xcalloc)
(xicalloc, xrealloc, xirealloc, xireallocarray, x2realloc)
(x2nrealloc, xmemdup, ximemdup, xstrdup, xnmalloc, xcharalloc):
Add _GL_ATTRIBUTE_DALLOC_FREE and _GL_ATTRIBUTE_RETURNS_NONNULL
attributes as appropriate.

3 years agognulib-common: update for gcc -Wmismatched-dealloc
Paul Eggert [Fri, 30 Jul 2021 19:56:24 +0000 (12:56 -0700)]
gnulib-common: update for gcc -Wmismatched-dealloc

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macros
_GL_ATTRIBUTE_DEALLOC and _GL_ATTRIBUTE_DEALLOC_FREE.  These can
be useful with gcc -Wmismatched-dealloc.

3 years agognulib-common: update for C2x 2020-12-11 draft
Paul Eggert [Fri, 30 Jul 2021 19:56:24 +0000 (12:56 -0700)]
gnulib-common: update for C2x 2020-12-11 draft

Use blessed-by-draft-standard way to test for [[__deprecated__]]
etc.; this is supported by GCC 11 and the fallback code should
work fine with GCC 10 and earlier, clang, etc.
* NEWS, doc/attribute.texi:
Mention that DEPRECATED etc. must now come first.
* lib/fflush.c, lib/unistr.in.h:
Do not include unused-parameter.h.  All uses of _GL_UNUSED_PARAMETER
(after parameters) replaced by _GL_ATTRIBUTE_MAYBE_UNUSED (before
parameters).  Although perhaps we need a shorter name for
_GL_ATTRIBUTE_MAYBE_UNUSED, that should probably be in
gnulib-common.m4, due to the ubiquity of this issue.
And perhaps the snippet/unused-parameter module should be marked
obsolete since it's no longer compatible with its old use.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macro
_GL_HAS_C_ATTRIBUTE, and use it instead of __STDC_VERSION__ in
deciding whether to use C2x attributes like [[__deprecated__]].
(_GL_ATTRIBUTE_MAYBE_UNUSED): Fall back on _GL_ATTRIBUTE_UNUSED.
(_GL_ATTRIBUTE_UNUSED): New macro, for labels where C2x
[[maybe_unused]] do not work.
(_GL_UNUSED, _GL_UNUSED_LABEL): Use it.
* modules/fflush, modules/unistr/base (Depends-on):
Remove snippet/unused-parameter.
* modules/fflush (selinux/selinux.h, selinux/context.h)
(selinux/label.h): Do not use $(UNUSED_PARAMETER).
Remove useless chmod a-x.

3 years agomanywarnings: document GCC 11 warnings
Paul Eggert [Fri, 30 Jul 2021 19:56:24 +0000 (12:56 -0700)]
manywarnings: document GCC 11 warnings

* build-aux/gcc-warning.spec: Add warnings introduced in GCC 11.
None of them require Gnulib code changes, so this is just
a documentation change.

3 years agolimits-h: add BOOL_MAX, BOOL_WIDTH
Paul Eggert [Fri, 30 Jul 2021 19:56:24 +0000 (12:56 -0700)]
limits-h: add BOOL_MAX, BOOL_WIDTH

* doc/posix-headers/limits.texi (limits.h): Document them.
* lib/limits.in.h: Also define CHAR_WIDTH etc. if C2x.
(BOOL_MAX, BOOL_WIDTH): New macros, from C2x.
* m4/limits-h.m4 (gl_LIMITS_H): Also check BOOL_WIDTH.

3 years agomaintainer-makefile: Respect cfg.mk setting announcement_Cc_, reverting most of the...
Simon Josefsson [Wed, 28 Jul 2021 08:37:57 +0000 (10:37 +0200)]
maintainer-makefile: Respect cfg.mk setting announcement_Cc_, reverting most of the previous patch.

* top/maint.mk (announcement_mail_Cc_stable): Rename back to
announcement_Cc_stable.
(announcement_Cc_alpha): Rename back to
announcement_mail_Cc_alpha.
(announcement_Cc_): Renamed from announcement_mail_Cc_.
(announcement_mail_headers_stable)
(announcement_mail_headers_alpha): Use announcement_Cc_ again.

3 years agomaintainer-makefile: Fix announcement mail CC's.
Simon Josefsson [Wed, 28 Jul 2021 08:23:37 +0000 (10:23 +0200)]
maintainer-makefile: Fix announcement mail CC's.

* top/maint.mk (announcement_Cc_stable): Rename to
announcement_mail_Cc_stable.
(announcement_Cc_alpha): Rename to announcement_mail_Cc_alpha.
(announcement_mail_headers_stable)
(announcement_mail_headers_alpha): Use announcement_mail_Cc_
instead of announcement_Cc_.

3 years agoAssume GNU gettext >= 0.17.
Bruno Haible [Sun, 25 Jul 2021 11:18:20 +0000 (13:18 +0200)]
Assume GNU gettext >= 0.17.

* modules/vasprintf (Notice): Remove.
* modules/xvasprintf (Notice): Remove.
* modules/xprintf (Notice): Remove.
* modules/error (Notice): Remove.
* modules/verror (Notice): Remove.
* modules/argp (Notice): Remove.
* modules/propername (Notice): Remove.
* lib/propername.h: Remove outdated comment.

3 years agogendocs.sh: Fix local rendering of HTML manuals.
Simon Josefsson [Mon, 19 Jul 2021 16:16:28 +0000 (18:16 +0200)]
gendocs.sh: Fix local rendering of HTML manuals.

* build-aux/gendocs.sh (htmlarg): Don't use relative URLs.

3 years agoexplicit_bzero-tests: pacify GCC better
Paul Eggert [Sun, 18 Jul 2021 19:08:56 +0000 (14:08 -0500)]
explicit_bzero-tests: pacify GCC better

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2021-07/msg00039.html
* tests/test-explicit_bzero.c: Ignore -Wmaybe-uninitialized.
(stackbuf): Remove this static pointer, reverting recent change.
(do_secret_stuff, test_stack): Revert these related changes too.

3 years agomemrchr-tests: pacify GCC
Paul Eggert [Sun, 18 Jul 2021 04:54:14 +0000 (23:54 -0500)]
memrchr-tests: pacify GCC

Pacify GCC 11.1.1 20210531 (Red Hat 11.1.1-3) x86-64.
* tests/test-memrchr.c: Disable -Wmaybe-uninitialized.

3 years agoexplicit_bzero-tests: pacify GCC
Paul Eggert [Sun, 18 Jul 2021 04:52:45 +0000 (23:52 -0500)]
explicit_bzero-tests: pacify GCC

Redo to pacify -Wmaybe-uninitialized with
GCC 11.1.1 20210531 (Red Hat 11.1.1-3) x86-64.
* tests/test-explicit_bzero.c (stackbuf): New static pointer.
(do_secret_stuff): Use it.
(test_stack): Set it to a local buffer.

3 years agoposixtm: pacify latest GCC
Paul Eggert [Sat, 17 Jul 2021 22:55:18 +0000 (17:55 -0500)]
posixtm: pacify latest GCC

Also, modernize while I’m at it.
* lib/posixtm.c: Include c-ctype.h, idx.h, intprops.h, verify.h
instead of stdlib.h.
(ISDIGIT): Remove.  All uses replaced by c_isdigit.
(year, posix_time_parse): Prefer idx_t to size_t.  Use assume
instead of abort.
(posixtime): Do not parse twice; once is enough.  That way, we
needn’t worry about a bogus warning about strcpy overrunning a
buffer from GCC 11.1.1 20210531 (Red Hat 11.1.1-3) x86-64
when coreutils is configured with --enable-gcc-warnings.
* modules/posixtm (Depends-on): Add c-ctype, intprops, verify.
Remove stpcpy.

3 years agoDon't use '#pragma weak' for thread functions in Linux/glibc>=2.34.
Bruno Haible [Sat, 17 Jul 2021 16:20:36 +0000 (18:20 +0200)]
Don't use '#pragma weak' for thread functions in Linux/glibc>=2.34.

Suggested by Florian Weimer <fweimer@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00211.html>.

* m4/threadlib.m4 (gl_PTHREADLIB_BODY): Set gl_pthread_in_glibc and set
LIBPMULTITHREAD accordingly.
(gl_STDTHREADLIB_BODY): Update comments.
(gl_THREADLIB_BODY): Define USE_POSIX_THREADS_FROM_LIBC.
* lib/glthread/thread.h (c11_threads_in_use): Define to 1 if all POSIX
thread functions are in libc.
* lib/glthread/lock.h (c11_threads_in_use): Likewise.
* lib/glthread/cond.h (c11_threads_in_use): Likewise.
* lib/glthread/tls.h (c11_threads_in_use): Likewise.

3 years agoFix cross-compilation test results.
Bruno Haible [Sat, 17 Jul 2021 15:32:18 +0000 (17:32 +0200)]
Fix cross-compilation test results.

* m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): When cross-compiling, include
<string.h> before testing __GNU_LIBRARY__.
* m4/strstr.m4 (gl_FUNC_STRSTR_SIMPLE): Likewise.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): Likewise.

3 years agoregex: modernize to newer regex bugset
Paul Eggert [Thu, 15 Jul 2021 04:55:30 +0000 (23:55 -0500)]
regex: modernize to newer regex bugset

Problem reported by Hiroo Hayashi in:
https://lists.gnu.org/r/bug-gnulib/2021-07/msg00024.html
* m4/regex.m4 (gl_REGEX): Allow newer glibc behavior for ()0|\1,
behavior where the regex compiles but does not match.
Test for glibc bug 11053.
* tests/test-regex.c (bug_regex11, main): Add casts needed
for printf portability.
(main): Allow newer glibc behavior for ()0|\1.

3 years agoregex: fix shell quoting problem in configuration
Paul Eggert [Thu, 15 Jul 2021 04:23:20 +0000 (23:23 -0500)]
regex: fix shell quoting problem in configuration

* m4/regex.m4 (gl_REGEX): Fix quoting problems.
These C programs are put into unquoted here-documents,
so $ and \ need to be quoted.

3 years agoautoupdate
Karl Berry [Mon, 12 Jul 2021 14:59:46 +0000 (07:59 -0700)]
autoupdate

3 years agoselect: port better to MinGW
Paul Eggert [Thu, 8 Jul 2021 17:00:30 +0000 (10:00 -0700)]
select: port better to MinGW

Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/bug-gnulib/2021-07/msg00017.html
* lib/select.c (rpl_select) [_WIN32 && !__CYGWIN__]:
Pass a SOCKET, not a HANDLE, to FD_ISSET.

3 years agoyear2038: Add --disable-year2038 option
Paul Eggert [Tue, 6 Jul 2021 22:21:44 +0000 (15:21 -0700)]
year2038: Add --disable-year2038 option

Also, document this stuff better.  Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2021-07/msg00011.html
* doc/year2038.texi: Document --disable-year2038.
* m4/year2038.m4 (gl_YEAR2038_BODY): Support ‘./configure
--disable-year2038’ to disable 64-bit time_t when that is not the
default.  Arg is now either empty or nonempty (not a shell
command) and is evaluated at m4 expansion time instead of at
runtime; all callers changed.

3 years agodoc: clarify which module fixes 32-bit time_t
Paul Eggert [Tue, 6 Jul 2021 22:08:05 +0000 (15:08 -0700)]
doc: clarify which module fixes 32-bit time_t

* doc/posix-headers/time.texi: Make it clear that the 32-bit
time_t problem is addressed by the year2038 module, not
by the time module.

3 years agoautoupdate
Karl Berry [Mon, 5 Jul 2021 15:51:09 +0000 (08:51 -0700)]
autoupdate

3 years agoautoupdate
Karl Berry [Fri, 2 Jul 2021 15:13:11 +0000 (08:13 -0700)]
autoupdate

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.