]> Savannah Git Hosting - gnulib.git/log
gnulib.git
5 years agoFix AC_CHECK_DECL so that it deactivates clang's built-in declarations.
Bruno Haible [Sat, 4 Jan 2020 12:15:45 +0000 (13:15 +0100)]
Fix AC_CHECK_DECL so that it deactivates clang's built-in declarations.

Reported by Martin Storsjö <martin@martin.st> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00016.html>.

* m4/00gnulib.m4 (gl_COMPILER_CLANG, gl_COMPILER_PREPARE_CHECK_DECL):
New macros.
(_AC_CHECK_DECL_BODY, AC_CHECK_DECL): Augment.

5 years agobtoc32: Add tests.
Bruno Haible [Sat, 4 Jan 2020 09:07:12 +0000 (10:07 +0100)]
btoc32: Add tests.

* tests/test-btoc32.c: New file, based on tests/test-btowc.c.
* tests/test-btoc32-1.sh: New file, based on tests/test-btowc1.sh.
* tests/test-btoc32-2.sh: New file, based on tests/test-btowc2.sh.
* modules/btoc32-tests: New file, based on modules/btowc-tests.

5 years agobtoc32: New module.
Bruno Haible [Sat, 4 Jan 2020 09:03:36 +0000 (10:03 +0100)]
btoc32: New module.

* lib/uchar.in.h (btoc32): New declaration.
* lib/btoc32.c: New file.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_BTOC32.
* modules/uchar (Makefile.am): Substitute GNULIB_BTOC32.
* modules/btoc32: New file.
* tests/test-uchar-c++.cc: Test the signature of btoc32.
* doc/posix-functions/btowc.texi: Mention the new module.

5 years agouchar tests: Avoid compilation error with HP cc.
Bruno Haible [Sat, 4 Jan 2020 01:46:44 +0000 (02:46 +0100)]
uchar tests: Avoid compilation error with HP cc.

* tests/test-uchar.c: Disable a test when HP cc is in use.

5 years agoc32tob: prefer https: URLs
Bruno Haible [Sat, 4 Jan 2020 01:46:12 +0000 (02:46 +0100)]
c32tob: prefer https: URLs

5 years agombrtoc32: Add tests.
Bruno Haible [Sat, 4 Jan 2020 01:35:26 +0000 (02:35 +0100)]
mbrtoc32: Add tests.

* tests/test-mbrtoc32.c: New file, based on tests/test-mbrtowc.c.
* tests/test-mbrtoc32-1.sh: New file, based on tests/test-mbrtowc1.sh.
* tests/test-mbrtoc32-2.sh: New file, based on tests/test-mbrtowc2.sh.
* tests/test-mbrtoc32-3.sh: New file, based on tests/test-mbrtowc3.sh.
* tests/test-mbrtoc32-4.sh: New file, based on tests/test-mbrtowc4.sh.
* tests/test-mbrtoc32-5.sh: New file, based on tests/test-mbrtowc5.sh.
* tests/test-mbrtoc32-w32.c: New file, based on tests/test-mbrtowc-w32.c.
* tests/test-mbrtoc32-w32-1.sh: New file, based on
tests/test-mbrtowc-w32-1.sh.
* tests/test-mbrtoc32-w32-2.sh: New file, based on
tests/test-mbrtowc-w32-2.sh.
* tests/test-mbrtoc32-w32-3.sh: New file, based on
tests/test-mbrtowc-w32-3.sh.
* tests/test-mbrtoc32-w32-4.sh: New file, based on
tests/test-mbrtowc-w32-4.sh.
* tests/test-mbrtoc32-w32-5.sh: New file, based on
tests/test-mbrtowc-w32-5.sh.
* tests/test-mbrtoc32-w32-6.sh: New file, based on
tests/test-mbrtowc-w32-6.sh.
* tests/test-mbrtoc32-w32-7.sh: New file, based on
tests/test-mbrtowc-w32-7.sh.
* modules/mbrtoc32-tests: New file, based on modules/mbrtowc-tests.

5 years agombrtoc32: New module.
Bruno Haible [Sat, 4 Jan 2020 01:32:52 +0000 (02:32 +0100)]
mbrtoc32: New module.

* lib/uchar.in.h (mbrtoc32): New declaration.
* lib/mbrtoc32.c: New file, based on lib/mbrtowc.c.
* m4/mbrtoc32.m4: New file, based on m4/mbrtowc.m4.
* m4/uchar.m4 (gl_UCHAR_H): Test whether mbrtoc32 is declared.
(gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBRTOC32, HAVE_MBRTOC32,
REPLACE_MBRTOC32.
* modules/uchar (Makefile.am): Substitute GNULIB_MBRTOC32,
HAVE_MBRTOC32, REPLACE_MBRTOC32.
* modules/mbrtoc32: New file, based on modules/mbrtowc.
* tests/test-uchar-c++.cc (mbrtoc32): Verify the signature.
* modules/uchar-c++-tests (Makefile.am): Link test-uchar-c++ with
$(LIB_MBRTOWC).
* doc/posix-functions/mbrtoc32.texi: Document the new module.
* doc/posix-functions/mbrtowc.texi: Mention the new module.

5 years agombrtowc: Refactor to share code with mbrtoc32.
Bruno Haible [Sat, 4 Jan 2020 01:31:39 +0000 (02:31 +0100)]
mbrtowc: Refactor to share code with mbrtoc32.

* lib/mbrtowc-impl.h: New file, extracted from lib/mbrtowc.c.
* lib/mbrtowc-impl-utf8.h: Likewise.
* lib/mbrtowc.c (mbrtowc): Define macro FITS_IN_CHAR_TYPE. Include
mbrtowc-impl.h.
* modules/mbrtowc (Files): Add the new files.

5 years agodoc: fix time.texi wording
Jim Meyering [Sat, 4 Jan 2020 01:09:13 +0000 (17:09 -0800)]
doc: fix time.texi wording

* doc/posix-headers/time.texi (time.h): Typo.

5 years agombrtowc: Refactor locale charset dispatching.
Bruno Haible [Fri, 3 Jan 2020 21:34:07 +0000 (22:34 +0100)]
mbrtowc: Refactor locale charset dispatching.

* lib/lc-charset-dispatch.h: New file, extracted from lib/mbrtowc.c.
* lib/lc-charset-dispatch.c: New file, extracted from lib/mbrtowc.c.
* lib/mbrtowc.c: Include lc-charset-dispatch.h. Don't include
localcharset.h, streq.h.
(enc_t): Remove type.
(locale_enc): Remove function.
(cached_locale_enc): Remove variable.
(locale_enc_cached): Remove function.
(mbrtowc): Invoke locale_encoding_classification.
* m4/mbrtowc.m4 (gl_PREREQ_MBRTOWC): Update comment.
* modules/mbrtowc (Files): Add lc-charset-dispatch.h,
lc-charset-dispatch.c.
(configure.ac): Arrange to compile lc-charset-dispatch.c.

5 years agodoc: mention 32-bit time_t issue
Paul Eggert [Fri, 3 Jan 2020 19:45:19 +0000 (11:45 -0800)]
doc: mention 32-bit time_t issue

* doc/posix-headers/sys_stat.texi (sys/stat.h):
* doc/posix-headers/time.texi (time.h): Mention 2038.

5 years agombrtowc: Ensure the mbtowc_lock is unique.
Bruno Haible [Fri, 3 Jan 2020 10:41:49 +0000 (11:41 +0100)]
mbrtowc: Ensure the mbtowc_lock is unique.

* lib/mbtowc-lock.c: New file, based on lib/setlocale-lock.c.
* lib/mbtowc-lock.h: New file, extracted from lib/mbrtowc.c and
lib/setlocale_null.c.
* lib/mbrtowc.c: Include headers needed for mbtowc-lock.h. Don't include
glthread/lock.h. Include mbtowc-lock.h.
(mbtowc_lock): Remove declaration.
(mbrtowc): Use mbtowc_with_lock.
* m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Require gl_PTHREADLIB. Check for
threads.h. Set LIB_MBRTOWC.
(gl_PREREQ_MBTOWC_LOCK): New macro.
* modules/mbrtowc (Files): Add lib/mbtowc-lock.h, lib/mbtowc-lock.c,
lib/windows-initguard.h, m4/threadlib.m4, m4/visibility.m4.
(Depends-on): Remove lock.
(configure.ac): Arrange to compile mbtowc-lock.c.
(Link): Mention $(LIB_MBRTOWC) instead of $(LIBTHREAD).
* modules/acl (Link): Likewise.
* modules/argmatch (Link): Likewise.
* modules/backup-rename (Link): Likewise.
* modules/backupfile (Link): Likewise.
* modules/closein (Link): Likewise.
* modules/closeout (Link): Likewise.
* modules/copy-file (Link): Likewise.
* modules/csharpcomp (Link): Likewise.
* modules/csharpexec (Link): Likewise.
* modules/dfa (Link): Likewise.
* modules/exclude (Link): Likewise.
* modules/fnmatch (Link): Likewise.
* modules/fnmatch-gnu (Link): Likewise.
* modules/fnmatch-posix (Link): Likewise.
* modules/glob (Link): Likewise.
* modules/human (Link): Likewise.
* modules/javacomp (Link): Likewise.
* modules/javaexec (Link): Likewise.
* modules/javaversion (Link): Likewise.
* modules/mbfile (Link): Likewise.
* modules/mbiter (Link): Likewise.
* modules/mbmemcasecmp (Link): Likewise.
* modules/mbmemcasecoll (Link): Likewise.
* modules/mbrlen (Link): Likewise.
* modules/mbscasecmp (Link): Likewise.
* modules/mbscasestr (Link): Likewise.
* modules/mbschr (Link): Likewise.
* modules/mbscspn (Link): Likewise.
* modules/mbsinit (Link): Likewise.
* modules/mbslen (Link): Likewise.
* modules/mbsncasecmp (Link): Likewise.
* modules/mbsnlen (Link): Likewise.
* modules/mbsnrtowcs (Link): Likewise.
* modules/mbspbrk (Link): Likewise.
* modules/mbspcasecmp (Link): Likewise.
* modules/mbsrchr (Link): Likewise.
* modules/mbsrtowcs (Link): Likewise.
* modules/mbssep (Link): Likewise.
* modules/mbsspn (Link): Likewise.
* modules/mbsstr (Link): Likewise.
* modules/mbstok_r (Link): Likewise.
* modules/mbswidth (Link): Likewise.
* modules/mbuiter (Link): Likewise.
* modules/mkdir-p (Link): Likewise.
* modules/propername (Link): Likewise.
* modules/quote (Link): Likewise.
* modules/quotearg (Link): Likewise.
* modules/quotearg-simple (Link): Likewise.
* modules/regex-quote (Link): Likewise.
* modules/rpmatch (Link): Likewise.
* modules/sh-quote (Link): Likewise.
* modules/system-quote (Link): Likewise.
* modules/trim (Link): Likewise.
* modules/unistdio/ulc-asnprintf (Link): Likewise.
* modules/unistdio/ulc-fprintf (Link): Likewise.
* modules/unistdio/ulc-vasnprintf (Link): Likewise.
* modules/unistdio/ulc-vasprintf (Link): Likewise.
* modules/unistdio/ulc-vfprintf (Link): Likewise.
* modules/unistdio/ulc-vsnprintf (Link): Likewise.
* modules/unistdio/ulc-vsprintf (Link): Likewise.
* modules/xfreopen (Link): Likewise.
* modules/xmemcoll (Link): Likewise.
* modules/yesno (Link): Likewise.
* modules/regex (Link): Add $(LIB_MBRTOWC).
* modules/acl-tests (Makefile.am): Link the programs with $(LIB_MBRTOWC)
instead of $(LIBTHREAD).
* modules/argmatch-tests (Makefile.am): Likewise.
* modules/closein-tests (Makefile.am): Likewise.
* modules/copy-file-tests (Makefile.am): Likewise.
* modules/dfa-tests (Makefile.am): Likewise.
* modules/fnmatch-tests (Makefile.am): Likewise.
* modules/glob-tests (Makefile.am): Likewise.
* modules/mbmemcasecmp-tests (Makefile.am): Likewise.
* modules/mbmemcasecoll-tests (Makefile.am): Likewise.
* modules/mbrtowc-tests (Makefile.am): Likewise.
* modules/mbscasecmp-tests (Makefile.am): Likewise.
* modules/mbscasestr-tests (Makefile.am): Likewise.
* modules/mbschr-tests (Makefile.am): Likewise.
* modules/mbscspn-tests (Makefile.am): Likewise.
* modules/mbsinit-tests (Makefile.am): Likewise.
* modules/mbsncasecmp-tests (Makefile.am): Likewise.
* modules/mbsnrtowcs-tests (Makefile.am): Likewise.
* modules/mbspbrk-tests (Makefile.am): Likewise.
* modules/mbspcasecmp-tests (Makefile.am): Likewise.
* modules/mbsrchr-tests (Makefile.am): Likewise.
* modules/mbsrtowcs-tests (Makefile.am): Likewise.
* modules/mbsspn-tests (Makefile.am): Likewise.
* modules/mbsstr-tests (Makefile.am): Likewise.
* modules/quotearg-simple-tests (Makefile.am): Likewise.
* modules/quotearg-tests (Makefile.am): Likewise.
* modules/readtokens-tests (Makefile.am): Likewise.
* modules/sh-quote-tests (Makefile.am): Likewise.
* modules/system-quote-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-asnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vasnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vasprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vsnprintf-tests (Makefile.am): Likewise.
* modules/unistdio/ulc-vsprintf-tests (Makefile.am): Likewise.
* modules/yesno-tests (Makefile.am): Likewise.
* modules/exclude-tests (Makefile.am): Link the programs with
$(LIB_MBRTOWC).
* modules/regex-tests (Makefile.am): Likewise.
* modules/regex-quote-tests (Makefile.am): Likewise.

5 years agogetopt-posix: Fix compilation failure in testdirs.
Bruno Haible [Fri, 3 Jan 2020 13:27:29 +0000 (14:27 +0100)]
getopt-posix: Fix compilation failure in testdirs.

* lib/unistd.in.h: Include <getopt-cdefs.h> and <getopt-pfx-core.h> only
when the gnulib module 'getopt-posix' is enabled.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize GNULIB_GETOPT_POSIX.
* modules/getopt-posix (configure.ac): Set GNULIB_GETOPT_POSIX as a
module indicator.
* modules/unistd (Makefile.am): Substitute GNULIB_GETOPT_POSIX.

5 years agodoc: Mention the 64-bit inode number problem.
Bruno Haible [Fri, 3 Jan 2020 13:19:15 +0000 (14:19 +0100)]
doc: Mention the 64-bit inode number problem.

* m4/largefile.m4 (AC_SYS_LARGEFILE): Mention that this macro fixes the
64-bit inode number problem.
* doc/posix-functions/stat.texi: Mention that this module fixes the
64-bit inode number problem.
* doc/posix-functions/lstat.texi: Likewise.
* doc/posix-functions/fstat.texi: Likewise.
* doc/posix-functions/readdir.texi: Add more details.
* doc/posix-functions/readdir_r.texi: Likewise.

5 years agowcrtomb: Add more tests.
Bruno Haible [Fri, 3 Jan 2020 00:26:10 +0000 (01:26 +0100)]
wcrtomb: Add more tests.

* tests/test-wcrtomb-w32.c: Include localcharset.h.
(test_one_locale): For the GB18030 and UTF-8 tests, verify that
locale_charset() returns the expected value; otherwise, skip the test.
* tests/test-wcrtomb-w32-6.sh: Remove old comment.
* tests/test-wcrtomb-w32-7.sh: Likewise.
* modules/wcrtomb-tests (Files): Add these files.
(Depends-on): Add localcharset.
(TESTS): Add test-wcrtomb-w32-6.sh, test-wcrtomb-w32-7.sh.

5 years agombrtowc: Add more tests.
Bruno Haible [Fri, 3 Jan 2020 00:23:24 +0000 (01:23 +0100)]
mbrtowc: Add more tests.

* tests/test-mbrtowc-w32.c: Include localcharset.h.
(test_one_locale): For the GB18030 and UTF-8 tests, verify that
locale_charset() returns the expected value; otherwise, skip the test.
* tests/test-mbrtowc-w32-6.sh: Remove old comment.
* tests/test-mbrtowc-w32-7.sh: Likewise.
* modules/mbrtowc-tests (Files): Add these files.
(Depends-on): Add localcharset.
(TESTS): Add test-mbrtowc-w32-6.sh, test-mbrtowc-w32-7.sh.

5 years agombrtowc: Fix test failures on MSVC (regression by previous commit).
Bruno Haible [Thu, 2 Jan 2020 22:12:57 +0000 (23:12 +0100)]
mbrtowc: Fix test failures on MSVC (regression by previous commit).

* m4/mbrtowc.m4 (gl_MBRTOWC_STORES_INCOMPLETE): New macro.
(gl_FUNC_MBRTOWC): Invoke it. Define MBRTOWC_STORES_INCOMPLETE_BUG.
* lib/mbrtowc.c (rpl_mbrtowc): Add workaround for
MBRTOWC_STORES_INCOMPLETE_BUG.
* doc/posix-functions/mbrtowc.texi: Mention the MSVC bug.

5 years agodoc: mention glibc bug 24269
Paul Eggert [Thu, 2 Jan 2020 22:08:58 +0000 (14:08 -0800)]
doc: mention glibc bug 24269

* doc/regex.texi (Back-reference Operator): Add glibc bug 24269.
Reformat slightly so that it looks nicer in the Grep manual.

5 years agombrtowc: Don't replace mbstate_t on MSVC.
Bruno Haible [Thu, 2 Jan 2020 19:20:05 +0000 (20:20 +0100)]
mbrtowc: Don't replace mbstate_t on MSVC.

* lib/wchar.in.h (GNULIB_defined_mbstate_t): Ignore a missing mbsinit function
on native Windows.

5 years agombrtowc: Don't replace mbstate_t on MSVC.
Bruno Haible [Thu, 2 Jan 2020 17:36:29 +0000 (18:36 +0100)]
mbrtowc: Don't replace mbstate_t on MSVC.

* m4/mbrtowc.m4 (gl_MBSTATE_T_BROKEN): Require AC_CANONICAL_HOST. Ignore
a missing mbsinit function on native Windows.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Strengthen the test, to detect an
MSVC bug.
* doc/posix-functions/wcrtomb.texi: Mention the MSVC bug.

5 years agosetlocale-null: Avoid crashing the MSVC linker.
Bruno Haible [Thu, 2 Jan 2020 15:12:04 +0000 (16:12 +0100)]
setlocale-null: Avoid crashing the MSVC linker.

* lib/setlocale-lock.c: Don't define IMP(gl_get_setlocale_null_lock) on
MSVC.

5 years agowchar: Make the HP-UX workaround work on HP-UX 11.31.
Bruno Haible [Thu, 2 Jan 2020 12:56:23 +0000 (13:56 +0100)]
wchar: Make the HP-UX workaround work on HP-UX 11.31.

* modules/wchar (Depends-on): Add inttypes-incomplete.
* lib/inttypes.in.h: Define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H.
* lib/wchar.in.h: Test _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H instead
of strtoimax.

5 years agombrtowc: Fix compilation error on IRIX (regression from 2019-12-26).
Bruno Haible [Thu, 2 Jan 2020 11:21:42 +0000 (12:21 +0100)]
mbrtowc: Fix compilation error on IRIX (regression from 2019-12-26).

* lib/mbrtowc.c: Include <stdint.h>.
* modules/mbrtowc (Depends-on): Add stdint.

5 years agomd5, sha1, sha256, sha512: support --with-openssl=auto-gpl-compat
Pádraig Brady [Wed, 1 Jan 2020 17:36:20 +0000 (17:36 +0000)]
md5, sha1, sha256, sha512: support --with-openssl=auto-gpl-compat

* m4/gl-openssl.m4: Add a new "auto-gpl-compat" mode,
which will auto enable use of openssl, only for >= version 3,
which is newly licensed under the Apache Software License.
This will be used from coreutils for example by adding
gl_SET_CRYPTO_CHECK_DEFAULT([auto-gpl-compat]) to configure.ac.
Even though "auto-gpl-compat" is less aggressive than "auto",
we leave the default at "no" so projects can opt in to the
extra dependency.

5 years agombrtowc: Include function name in macro names.
Bruno Haible [Wed, 1 Jan 2020 21:04:47 +0000 (22:04 +0100)]
mbrtowc: Include function name in macro names.

* m4/mbrtowc.m4 (gl_FUNC_MBRTOWC): Define
MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not C_LOCALE_MAYBE_EILSEQ.
(gl_MBRTOWC_C_LOCALE): Change cache variable name to
gl_cv_func_mbrtowc_C_locale_sans_EILSEQ.
* lib/mbrtowc.c: Test MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ, not
C_LOCALE_MAYBE_EILSEQ.

5 years agoc32tob: New module.
Bruno Haible [Wed, 1 Jan 2020 16:01:54 +0000 (17:01 +0100)]
c32tob: New module.

* lib/uchar.in.h (_GL_LARGE_CHAR32_T): New macro.
(c32tob): New declaration.
* lib/c32tob.c: New file.
* m4/uchar.m4 (gl_UCHAR_MODULE_INDICATOR, gl_UCHAR_H_DEFAULTS): New
macros.
(gl_UCHAR_H): Require gl_UCHAR_H_DEFAULTS.
* modules/uchar (Depends-on): Add snippet/c++defs.
(Makefile.am): Include c++defs.h and substitute GNULIB_C32TOB in
uchar.h.
* modules/c32tob: New file.
* tests/test-uchar.c: Verify that _GL_LARGE_CHAR32_T is correctly
defined.
* tests/test-uchar-c++.cc: Include signature.h. Test the signature of
c32tob.
* modules/uchar-c++-tests (Files): Add tests/signature.h.
* doc/posix-functions/wctob.texi: Mention the new module.

5 years agolocale C++ tests: Fix link error on AIX (regression from 2019-12-18).
Bruno Haible [Wed, 1 Jan 2020 15:53:26 +0000 (16:53 +0100)]
locale C++ tests: Fix link error on AIX (regression from 2019-12-18).

* modules/locale-c++-tests (Makefile.am): Link test-locale-c++ with
$(LIB_SETLOCALE).

5 years agohard-locale tests: Fix a conflict with the C++ tests.
Bruno Haible [Wed, 1 Jan 2020 15:42:49 +0000 (16:42 +0100)]
hard-locale tests: Fix a conflict with the C++ tests.

* modules/hard-locale-tests (Makefile.am): Build a program named
'current-locale', not 'locale'.

5 years agodoc: Update documentation about wchar_t.
Bruno Haible [Wed, 1 Jan 2020 15:34:39 +0000 (16:34 +0100)]
doc: Update documentation about wchar_t.

* doc/*/*wc*.texi: Clarify that 64-bit AIX does not have a too small
wchar_t type.

5 years agombrtowc tests: Fix typos.
Bruno Haible [Wed, 1 Jan 2020 13:54:32 +0000 (14:54 +0100)]
mbrtowc tests: Fix typos.

* tests/test-mbrtowc.c (main): Fix typo.
* tests/test-mbrtowc-w32.c (test_one_locale): Likewise.

5 years agomaint: update copyright notices
Paul Eggert [Wed, 1 Jan 2020 01:33:19 +0000 (17:33 -0800)]
maint: update copyright notices

Before doing the following changes done by hand, I also ran ‘make
update-copyright’ and ‘config/srclist-update <config/srclist.txt’
to do most of the copyright years automatically.  A few upstream
sources are still in 2019 but these should eventually be changed
automatically too.
* build-aux/declared.sh (func_version):
* build-aux/libtool-next-version (func_version):
* build-aux/run-test (func_version):
Update these notices by hand.  Put just the last year
in output of programs, as per GNU coding standards.

5 years agoautoupdate
Paul Eggert [Wed, 1 Jan 2020 01:22:24 +0000 (17:22 -0800)]
autoupdate

5 years agomaint: Run 'make update-copyright'
Paul Eggert [Wed, 1 Jan 2020 00:00:18 +0000 (00:00 +0000)]
maint: Run 'make update-copyright'

5 years agouchar: Add C++ tests.
Bruno Haible [Tue, 31 Dec 2019 18:38:50 +0000 (19:38 +0100)]
uchar: Add C++ tests.

* tests/test-uchar-c++.cc: New file.
* tests/test-uchar-c++2.cc: New file.
* modules/uchar-c++-tests: New file.

5 years agouchar: Add tests.
Bruno Haible [Tue, 31 Dec 2019 18:37:01 +0000 (19:37 +0100)]
uchar: Add tests.

* tests/test-uchar.c: New file.
* modules/uchar-tests: New file.

5 years agouchar: New module.
Bruno Haible [Tue, 31 Dec 2019 18:35:48 +0000 (19:35 +0100)]
uchar: New module.

* lib/uchar.in.h: New file.
* m4/uchar.m4: New file.
* modules/uchar: New file.
* doc/posix-headers/uchar.texi: Mention the new module.

5 years agolocaleinfo: ->simple would be wrong for LC_ALL=C
Jim Meyering [Tue, 31 Dec 2019 07:23:42 +0000 (23:23 -0800)]
localeinfo: ->simple would be wrong for LC_ALL=C

That would lead to using unnecessary and expensive code paths in dfa.c.
* lib/localeinfo.c (using_simple_locale): Fix recently-introduced logic
error that would have made grep many times slower in the C locale.
With this change, and a file created like this:
  yes 00 | head -10000000 > in
Running grep as follows becomes more than 40 times faster:
  LC_ALL=C grep -Fw 0 in

5 years agodoc: Add URLs.
Bruno Haible [Mon, 30 Dec 2019 20:02:45 +0000 (21:02 +0100)]
doc: Add URLs.

* doc/regex.texi (Back-reference Operator): Add URLs into glibc bug tracker.

5 years agodoc: fix typo in previous patch
Paul Eggert [Mon, 30 Dec 2019 08:56:43 +0000 (00:56 -0800)]
doc: fix typo in previous patch

5 years agodoc: document trouble with back-references
Paul Eggert [Mon, 30 Dec 2019 08:22:05 +0000 (00:22 -0800)]
doc: document trouble with back-references

* doc/regex.texi (Back-reference Operator): Mention bugs etc.

5 years agodoc: use “back-reference” for \1 etc.
Paul Eggert [Mon, 30 Dec 2019 07:02:19 +0000 (23:02 -0800)]
doc: use “back-reference” for \1 etc.

* doc/regex.texi: Consistently spell “back-reference” with
a hyphen, since that’s how POSIX does it.

5 years agotest-framework-sh: tighten an internal grep regexp
Jim Meyering [Thu, 26 Dec 2019 23:59:11 +0000 (15:59 -0800)]
test-framework-sh: tighten an internal grep regexp

* tests/init.sh (gl_shell_test_script_): Tighten the grep regexp
that helps test for a working printf.

5 years agotest-framework-sh: Avoid /bin/sh on AIX 7.2 due to its printf built-in.
Bruno Haible [Thu, 26 Dec 2019 11:29:20 +0000 (12:29 +0100)]
test-framework-sh: Avoid /bin/sh on AIX 7.2 due to its printf built-in.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/grep-devel/2019-12/msg00020.html>.
Simplification by Jim Meyering.

* tests/init.sh (gl_shell_test_script_): Add a test of printf of an
octal escape sequence in a UTF-8 locale.

5 years agombrtowc: port better to narrow-wchar_t platforms
Paul Eggert [Thu, 26 Dec 2019 08:50:12 +0000 (00:50 -0800)]
mbrtowc: port better to narrow-wchar_t platforms

* lib/mbrtowc.c (mbrtowc): On platforms like AIX 7.2, where
wchar_t is too narrow to represent all the Unicode characters,
consider a byte sequence for an out-of-wchar_t-range character to
be an encoding error.  This fixes grep’s surrogate-pair test
failure on AIX 7.2.

5 years agolocalcharset: Avoid referencing rpl_setlocale on native Windows.
Bruno Haible [Tue, 24 Dec 2019 23:00:44 +0000 (00:00 +0100)]
localcharset: Avoid referencing rpl_setlocale on native Windows.

* lib/localcharset.c (setlocale): Undefine.

5 years agolock tests: Fix link error on HP-UX/hppa (regression from 2019-12-21).
Bruno Haible [Tue, 24 Dec 2019 20:27:36 +0000 (21:27 +0100)]
lock tests: Fix link error on HP-UX/hppa (regression from 2019-12-21).

* m4/semaphore.m4: New file.
* modules/lock-tests (Files): Add it.
(configure.ac): Require gl_SEMAPHORE.
(Makefile.am): Link test-lock with $(LIB_SEMAPHORE).

5 years agostrptime: fix typo in previous patch
Paul Eggert [Tue, 24 Dec 2019 18:31:42 +0000 (10:31 -0800)]
strptime: fix typo in previous patch

Problem and fix reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00202.html
* lib/strptime.c (day_of_the_week): Fix paren bug.

5 years agosetlocale-null: Make it easy to rely on the lock in another library.
Bruno Haible [Tue, 24 Dec 2019 16:23:23 +0000 (17:23 +0100)]
setlocale-null: Make it easy to rely on the lock in another library.

* lib/setlocale-lock.c: Do not define anything if OMIT_SETLOCALE_LOCK is
defined.

5 years agostrptime: tweak division performance
Paul Eggert [Tue, 24 Dec 2019 07:53:23 +0000 (23:53 -0800)]
strptime: tweak division performance

* lib/strptime.c (day_of_the_week):
Redo with neither ‘%’ nor conditional branches.

5 years agonstrftime: tweak division performance
Paul Eggert [Tue, 24 Dec 2019 07:48:35 +0000 (23:48 -0800)]
nstrftime: tweak division performance

* lib/nstrftime.c (SHR, tm_diff, __strftime_internal):
Redo with neither ‘%’ nor conditional branches.

5 years agomktime: tweak division performance
Paul Eggert [Tue, 24 Dec 2019 07:47:37 +0000 (23:47 -0800)]
mktime: tweak division performance

* config/srclist.txt: Do not sync mktime.c for now.
* lib/mktime.c (shr, ydhms_diff):
Redo with neither ‘%’ nor conditional branches.

5 years agogethrxtime: improve xtime_sec performance
Paul Eggert [Tue, 24 Dec 2019 03:04:50 +0000 (19:04 -0800)]
gethrxtime: improve xtime_sec performance

Performanced analyzed by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00200.html
* lib/xtime.h (xtime_sec): Redo with neither ‘%’ nor conditional
branches.

5 years agosetlocale-null: Export the lock function also on non-Windows platforms.
Bruno Haible [Mon, 23 Dec 2019 07:55:35 +0000 (08:55 +0100)]
setlocale-null: Export the lock function also on non-Windows platforms.

* lib/setlocale-lock.c (DLL_EXPORTED): New macro.
(gl_get_setlocale_null_lock): Declare as DLL_EXPORTED.
* m4/setlocale_null.m4 (gl_PREREQ_SETLOCALE_LOCK): New macro.
* modules/setlocale-null (configure.ac): Invoke it.
(Files): Add m4/visibility.m4.

5 years agogethrxtime: fix rounding bug with negative args
Paul Eggert [Sun, 22 Dec 2019 20:32:31 +0000 (12:32 -0800)]
gethrxtime: fix rounding bug with negative args

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00192.html
* lib/xtime.h (xtime_sec): Simplify calculation and correct bug
with negative rounding.  Common platforms can compute / and % with
a single instruction, so the simplified code should be shorter and
faster on these platforms anyway.

5 years agogethrxtime: remove incorrect overflow detection
Paul Eggert [Sun, 22 Dec 2019 20:38:22 +0000 (12:38 -0800)]
gethrxtime: remove incorrect overflow detection

This is part of a patch written by Bruno Haible:
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00192.html
* lib/xtime.h (xtime_make): Remove attempt to prevent internal
integer overflow, as it didn’t suffice.  This reverts the xtime.h
part of 2018-10-12T04:46:09Z!akim.demaille@gmail.com, which I
cannot now see the need for anyway (even in cases where it works),
as the patch is helpful only when the signs of S and NS disagree,
and all callers pass nonnegative values for S and NS.
Instead, add a comment saying args should be nonnegative.

5 years agosetlocale-null: Add standalone include file.
Bruno Haible [Sun, 22 Dec 2019 18:34:41 +0000 (19:34 +0100)]
setlocale-null: Add standalone include file.

* lib/setlocale_null.h: New file, extracted from lib/locale.in.h.
* lib/locale.in.h: Include setlocale_null.h.
(SETLOCALE_NULL_MAX, SETLOCALE_NULL_ALL_MAX, setlocale_null_r,
setlocale_null): Remove declarations.
* lib/setlocale_null.c: Include setlocale_null.h.
* lib/localename.c: Likewise.
* modules/setlocale-null (Files): Add lib/setlocale_null.h.
(Depends-on): Add snippet/arg-nonnull.
(Include): Allow either "setlocale_null.h" or <locale.h>.

5 years agostrfmon_l: Fix test failures on FreeBSD and Cygwin.
Bruno Haible [Sun, 22 Dec 2019 15:55:27 +0000 (16:55 +0100)]
strfmon_l: Fix test failures on FreeBSD and Cygwin.

* m4/strfmon_l.m4 (gl_FUNC_STRFMON_L): Require gt_LOCALE_FR_UTF8. Add an
AC_RUN_IFELSE test.
* modules/strfmon_l (Files): Add locale-fr.m4, codeset.m4.
* doc/posix-functions/strfmon_l.texi: Mention the FreeBSD and Cygwin
problem.

5 years agoPrefer lib_SOURCES to unconditional AC_LIBOBJ.
Bruno Haible [Sun, 22 Dec 2019 09:57:00 +0000 (10:57 +0100)]
Prefer lib_SOURCES to unconditional AC_LIBOBJ.

* modules/at-internal: Prefer a lib_SOURCES augmentation to an
unconditional AC_LIBOBJ.
* modules/selinux-at: Likewise.
* modules/xmemdup0: Likewise.
* modules/xstrtoll: Likewise.

5 years agolonglong: Mark module obsolete.
Bruno Haible [Sun, 22 Dec 2019 09:21:37 +0000 (10:21 +0100)]
longlong: Mark module obsolete.

* modules/longlong (Status, Notice): New sections.

5 years agostdint: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 09:20:30 +0000 (10:20 +0100)]
stdint: Assume that the compiler supports 'long long'.

* lib/stdint.in.h (int64_t, uint64_t, intmax_t, uintmax_t, INT64_C,
UINT64_C, INTMAX_C, UINTMAX_C): Assume HAVE_LONG_LONG_INT and
HAVE_UNSIGNED_LONG_LONG_INT to be 1.
* m4/stdint.m4 (gl_STDINT_H): Don't require AC_TYPE_LONG_LONG_INT,
AC_TYPE_UNSIGNED_LONG_LONG_INT.
* modules/stdint (Files): Remove longlong.m4.
(Makefile.am): Don't substitute HAVE_LONG_LONG_INT,
HAVE_UNSIGNED_LONG_LONG_INT.

5 years agointtypes-incomplete: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 09:12:54 +0000 (10:12 +0100)]
inttypes-incomplete: Assume that the compiler supports 'long long'.

* lib/inttypes.in.h (_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX,
_SCNu64_PREFIX): Assume HAVE_LONG_LONG_INT and
HAVE_UNSIGNED_LONG_LONG_INT to be 1.
* m4/inttypes.m4 (gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION): Assume
HAVE_LONG_LONG_INT to be 1.
* modules/inttypes-incomplete (Makefile.am): Don't substitute
HAVE_LONG_LONG_INT, HAVE_UNSIGNED_LONG_LONG_INT.

5 years agomalloca: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 09:08:36 +0000 (10:08 +0100)]
malloca: Assume that the compiler supports 'long long'.

* lib/malloca.h: Assume HAVE_LONG_LONG_INT to be 1.
* m4/malloca.m4 (gl_MALLOCA): Don't require AC_TYPE_LONG_LONG_INT.
* modules/malloca (Files): Remove longlong.m4.
* modules/relocatable-prog-wrapper (Files): Likewise.

5 years agoatoll: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 09:06:04 +0000 (10:06 +0100)]
atoll: Assume that the compiler supports 'long long'.

* m4/atoll.m4 (gl_FUNC_ATOLL): Don't require AC_TYPE_LONG_LONG_INT.
* modules/atoll (Files): Remove longlong.m4.

5 years agostrtoll: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 09:04:37 +0000 (10:04 +0100)]
strtoll: Assume that the compiler supports 'long long'.

* m4/strtoll.m4 (gl_FUNC_STRTOLL): Don't require AC_TYPE_LONG_LONG_INT.
* modules/strtoll (Files): Remove longlong.m4.

5 years agostrtoull: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 09:03:30 +0000 (10:03 +0100)]
strtoull: Assume that the compiler supports 'long long'.

* m4/strtoull.m4 (gl_FUNC_STRTOULL): Don't require
AC_TYPE_UNSIGNED_LONG_LONG_INT.
* modules/strtoull (Files): Remove longlong.m4.

5 years agostrtoimax, strtoumax: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 08:59:49 +0000 (09:59 +0100)]
strtoimax, strtoumax: Assume that the compiler supports 'long long'.

* lib/strtoimax.c: Assume HAVE_LONG_LONG_INT and
HAVE_UNSIGNED_LONG_LONG_INT to be 1.
* m4/strtoimax.m4 (gl_PREREQ_STRTOIMAX): Don't require
AC_TYPE_LONG_LONG_INT.
* m4/strtoumax.m4 (gl_PREREQ_STRTOUMAX): Don't require
AC_TYPE_UNSIGNED_LONG_LONG_INT.
* modules/strtoimax (Files): Remove longlong.m4.
* modules/strtoumax (Files): Likewise.

5 years agoxstrtoll: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 08:57:17 +0000 (09:57 +0100)]
xstrtoll: Assume that the compiler supports 'long long'.

* lib/xstrtol.h (xstrtoll, xstrtoull): Declare unconditionally.
* modules/xstrtoll (configure.ac): Don't invoke AC_TYPE_LONG_LONG_INT.

5 years agovasnprintf: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 08:55:04 +0000 (09:55 +0100)]
vasnprintf: Assume that the compiler supports 'long long'.

* lib/printf-args.h: Assume HAVE_LONG_LONG_INT to be 1.
* lib/printf-args.c (PRINTF_FETCHARGS): Likewise.
* lib/printf-parse.c (PRINTF_PARSE): Likewise.
* lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Likewise.
* m4/intmax_t.m4 (gl_AC_TYPE_INTMAX_T, gt_AC_TYPE_INTMAX_T): Don't
require AC_TYPE_LONG_LONG_INT.
* m4/vasnprintf.m4 (gl_PREREQ_PRINTF_ARGS, gl_PREREQ_PRINTF_PARSE,
gl_PREREQ_VASNPRINTF): Likewise.
* modules/vasnprintf (Files): Remove longlong.m4.
* modules/c-vasnprintf (Files): Likewise.
* modules/unistdio/u8-vasnprintf (Files): Likewise.
* modules/unistdio/u8-u8-vasnprintf (Files): Likewise.
* modules/unistdio/u16-vasnprintf (Files): Likewise.
* modules/unistdio/u16-u16-vasnprintf (Files): Likewise.
* modules/unistdio/u32-vasnprintf (Files): Likewise.
* modules/unistdio/u32-u32-vasnprintf (Files): Likewise.
* modules/unistdio/ulc-vasnprintf (Files): Likewise.

5 years agogethrxtime: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 08:46:46 +0000 (09:46 +0100)]
gethrxtime: Assume that the compiler supports 'long long'.

* lib/xtime.h (xtime_t): Define to 'long long int' always.
(XTIME_PRECISION): Define to 1000000000 always.
(xtime_make, xtime_sec): Optimize accordingly.
* m4/gethrxtime.m4 (gl_XTIME): Don't require AC_TYPE_LONG_LONG_INT.
* modules/gethrxtime (Files): Remove longlong.m4.

5 years agointeger_length*: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 08:43:25 +0000 (09:43 +0100)]
integer_length*: Assume that the compiler supports 'long long'.

* lib/integer_length.h (integer_length_ll): Declare unconditionally.
* modules/integer_length (Files): Remove longlong.m4.
(configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT.
* modules/integer_length_l (Files): Remove longlong.m4.
(configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT.
* modules/integer_length_ll (Files): Remove longlong.m4.
(configure.ac): Don't require AC_TYPE_UNSIGNED_LONG_LONG_INT.

5 years agocount-one-bits: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 08:34:06 +0000 (09:34 +0100)]
count-one-bits: Assume that the compiler supports 'long long'.

* lib/count-one-bits.h (count_one_bits_ll): Define unconditionally.
* m4/count-one-bits.m4: Remove file.
* modules/count-one-bits (Files): Remove it.
(configure.ac): Don't invoke gl_COUNT_ONE_BITS.
* tests/test-count-one-bits.c (main): Test count_one_bits_ll
unconditionally.

5 years agocount-trailing-zeros: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 08:33:17 +0000 (09:33 +0100)]
count-trailing-zeros: Assume that the compiler supports 'long long'.

* lib/count-trailing-zeros.h (count_trailing_zeros_ll): Define
unconditionally.
* m4/count-trailing-zeros.m4: Remove file.
* modules/count-trailing-zeros (Files): Remove it.
(configure.ac): Don't invoke gl_COUNT_TRAILING_ZEROS.
* tests/test-count-trailing-zeros.c (main): Test count_trailing_zeros_ll
unconditionally.

5 years agocount-leading-zeros: Assume that the compiler supports 'long long'.
Bruno Haible [Sun, 22 Dec 2019 08:32:07 +0000 (09:32 +0100)]
count-leading-zeros: Assume that the compiler supports 'long long'.

* lib/count-leading-zeros.h (count_leading_zeros_ll): Define
unconditionally.
* m4/count-leading-zeros.m4: Remove file.
* modules/count-leading-zeros (Files): Remove it.
(configure.ac): Don't invoke gl_COUNT_LEADING_ZEROS.
* tests/test-count-leading-zeros.c (main): Test count_leading_zeros_ll
unconditionally.

5 years agolocalcharset: Update support for OpenBSD.
Bruno Haible [Sun, 22 Dec 2019 07:03:24 +0000 (08:03 +0100)]
localcharset: Update support for OpenBSD.

* lib/localcharset.c (alias_table): Map "US-ASCII" to "ASCII".

5 years agopthread_sigmask: Avoid test failure on NetBSD 8.0.
Bruno Haible [Sat, 21 Dec 2019 17:22:38 +0000 (18:22 +0100)]
pthread_sigmask: Avoid test failure on NetBSD 8.0.

* tests/test-pthread_sigmask2.c (main): Skip the error handling test on
NetBSD.
* doc/posix-functions/pthread_sigmask.texi: Mention the NetBSD problem.

5 years agothreadlib: Improve code structure.
Bruno Haible [Sat, 21 Dec 2019 16:56:26 +0000 (17:56 +0100)]
threadlib: Improve code structure.

* m4/threadlib.m4: Reorder macros. Add comments.

5 years agoautoupdate
Karl Berry [Sat, 21 Dec 2019 16:46:35 +0000 (08:46 -0800)]
autoupdate

5 years agothreadlib: Fix LIBMULTITHREAD on FreeBSD with --enable-threads=isoc.
Bruno Haible [Sat, 21 Dec 2019 12:53:31 +0000 (13:53 +0100)]
threadlib: Fix LIBMULTITHREAD on FreeBSD with --enable-threads=isoc.

* m4/threadlib.m4 (gl_STDTHREADLIB_BODY): New macro (some code moved
here from m4/threads.m4).
(gl_THREADLIB_BODY): Don't test whether mtx_lock and cnd_timedwait exist
in libc. Instead, rely on gl_STDTHREADLIB_BODY.
(gl_STDTHREADLIB): New macro.
* m4/threads.m4 (gl_THREADS_H): Require gl_STDTHREADLIB instead of
gl_THREADLIB_BODY and gl_YIELD. Don't set LIBSTDTHREAD here.

5 years agosched_yield: Don't depend on threadlib and yield.
Bruno Haible [Sat, 21 Dec 2019 12:36:03 +0000 (13:36 +0100)]
sched_yield: Don't depend on threadlib and yield.

* m4/threadlib.m4 (gl_PTHREADLIB): Document that it sets
LIB_SCHED_YIELD.
(gl_PTHREADLIB_BODY): Set LIB_SCHED_YIELD (code moved here from
m4/yield.m4).
* m4/sched_yield.m4 (gl_FUNC_SCHED_YIELD): Require gl_PTHREADLIB, not
gl_THREADLIB and gl_YIELD.
* m4/yield.m4 (gl_YIELD): Require gl_PTHREADLIB. Determine YIELD_LIB
based on $(LIB_SCHED_YIELD).
* m4/threads.m4 (gl_THREADS_H): Don't require gl_YIELD. Use
$(LIB_SCHED_YIELD), not $(YIELD_LIB).
* modules/sched_yield (Files): Remove yield.m4. Add threadlib.m4.
(Depends-on): Remove threadlib.
(Link): Mention $(LIB_SCHED_YIELD), not $(YIELD_LIB).
* modules/threads-h (Files): Remove m4/yield.m4.
* modules/pthread-cond-tests (Makefile.am): Link the programs against
$(LIB_SCHED_YIELD), not $(YIELD_LIB).
* modules/pthread-mutex-tests (Makefile.am): Likewise.
* modules/pthread-once-tests (Makefile.am): Likewise.
* modules/pthread-rwlock-tests (Makefile.am): Likewise.
* modules/pthread-tss-tests (Makefile.am): Likewise.

5 years agothreads-h: Don't depend on threadlib.
Bruno Haible [Sat, 21 Dec 2019 12:16:44 +0000 (13:16 +0100)]
threads-h: Don't depend on threadlib.

* modules/threads-h (configure.ac-early): Invoke gl_ANYTHREADLIB_EARLY,
not gl_THREADLIB_EARLY.

5 years agonl_langinfo tests: Fix link error (regression from 2019-12-18).
Bruno Haible [Sat, 21 Dec 2019 11:54:51 +0000 (12:54 +0100)]
nl_langinfo tests: Fix link error (regression from 2019-12-18).

* modules/nl_langinfo-tests (Makefile.am): Link also test-nl_langinfo
with $(LIB_SETLOCALE).

5 years agothreadlib: Remove unused dependency (left over from 2019-07-06).
Bruno Haible [Sat, 21 Dec 2019 11:51:50 +0000 (12:51 +0100)]
threadlib: Remove unused dependency (left over from 2019-07-06).

* modules/threadlib (Depends-on): Remove havelib.

5 years agoNew convention for multithread-safety tests.
Bruno Haible [Sat, 21 Dec 2019 06:41:08 +0000 (07:41 +0100)]
New convention for multithread-safety tests.

* tests/test-setlocale_null-mt-one.c: Renamed from
tests/test-setlocale_null-one.c.
* tests/test-setlocale_null-mt-all.c: Renamed from
tests/test-setlocale_null-all.c.
* modules/setlocale-null-tests (Files, Makefile.am): Update.

5 years agoquotearg tests: Fix conflict with hard-locale tests.
Bruno Haible [Sat, 21 Dec 2019 06:32:12 +0000 (07:32 +0100)]
quotearg tests: Fix conflict with hard-locale tests.

* tests/testlocale: Renamed from tests/locale.
* modules/quotearg-tests (Files): Update.
* tests/test-quotearg.sh (LOCALEDIR): Likewise.

5 years agopthread-thread, lock: On z/OS, use PTHREAD_RWLOCK_INITIALIZER_NP.
Bruno Haible [Sat, 21 Dec 2019 05:29:11 +0000 (06:29 +0100)]
pthread-thread, lock: On z/OS, use PTHREAD_RWLOCK_INITIALIZER_NP.

Reported by Daniel Richard G. in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00001.html>
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00167.html>

* lib/pthread.in.h (PTHREAD_RWLOCK_INITIALIZER): Define to
PTHREAD_RWLOCK_INITIALIZER_NP when possible.
* lib/glthread/lock.h: Allow PTHREAD_RWLOCK_INITIALIZER_NP as an
alternative to PTHREAD_RWLOCK_INITIALIZER.
* lib/glthread/lock.c: Likewise.

5 years agomemcmp tests: Work around the clang bug.
Bruno Haible [Sat, 21 Dec 2019 04:42:11 +0000 (05:42 +0100)]
memcmp tests: Work around the clang bug.

* tests/test-memcmp.c (main): Use a volatile function pointer to disable
the clang optimization.

5 years agolocalcharset: Add support for z/OS encoding names.
Bruno Haible [Fri, 20 Dec 2019 08:17:20 +0000 (09:17 +0100)]
localcharset: Add support for z/OS encoding names.

* lib/localcharset.h: Mention which encodings are used as locale
encodings on z/OS.

5 years agoiconv_open: Add support for z/OS encoding names.
Bruno Haible [Fri, 20 Dec 2019 08:12:37 +0000 (09:12 +0100)]
iconv_open: Add support for z/OS encoding names.

Reported by Daniel Richard G. in
<https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00172.html>.

* lib/iconv_open-zos.gperf: New file.
* modules/iconv_open (Files): Add iconv_open-zos.gperf.
(Makefile.am): Add rules for generating iconv_open-zos.h from it.
* lib/iconv_open.c (ICONV_FLAVOR_ZOS): New macro.
* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): On z/OS, use ICONV_FLAVOR_ZOS.
* doc/posix-functions/iconv_open.texi: Mention z/OS.

5 years agodoc: Document the problem of the per-thread locale functions on z/OS.
Bruno Haible [Fri, 20 Dec 2019 06:42:28 +0000 (07:42 +0100)]
doc: Document the problem of the per-thread locale functions on z/OS.

* doc/posix-functions/uselocale.texi: Document the z/OS problem.
* doc/posix-functions/newlocale.texi: Likewise.
* doc/posix-functions/duplocale.texi: Likewise.
* doc/posix-functions/freelocale.texi: Likewise.

5 years agolocalename, gettext: Fix host_os value for z/OS.
Bruno Haible [Fri, 20 Dec 2019 06:29:02 +0000 (07:29 +0100)]
localename, gettext: Fix host_os value for z/OS.

* m4/intl-thread-locale.m4 (gt_FUNC_USELOCALE): Fix host_os value in
cross-configuration code.

5 years agonstrftime: avoid a shadowing warning
Jim Meyering [Fri, 20 Dec 2019 04:17:27 +0000 (20:17 -0800)]
nstrftime: avoid a shadowing warning

* lib/nstrftime.c (libc_hidden_def): Rename inner "i" to "j",
to avoid shadowing an "i" declared hundreds of lines above.

5 years agodfa: struct dfamust now uses flexible array
Paul Eggert [Thu, 19 Dec 2019 22:35:59 +0000 (14:35 -0800)]
dfa: struct dfamust now uses flexible array

* lib/dfa.c: Include flexmember.h.
(dfamust, dfamustfree): Adjust to struct dfamust change.
This saves a call to malloc+free.
* lib/dfa.h (struct dfamust): Make the final member a
flexible array member.
* modules/dfa (Depends-on): Add flexmember.

5 years agodfa: fast->small for array elements
Paul Eggert [Thu, 19 Dec 2019 21:37:45 +0000 (13:37 -0800)]
dfa: fast->small for array elements

* lib/dfa.c (charclass_word): Use uint_least64_t not uint_fast64_t,
since this type is used in arrays.  This change is more for
documentation than for any practical effect, since the two types
are the same on all known platforms.

5 years agoiconv tests: Test canonicalized, not system-dependent, encoding names.
Bruno Haible [Thu, 19 Dec 2019 05:20:30 +0000 (06:20 +0100)]
iconv tests: Test canonicalized, not system-dependent, encoding names.

* modules/iconv-tests (Depends-on): Add iconv_open.

5 years agoiconv tests: Test canonicalized, not system-dependent, encoding names.
Bruno Haible [Thu, 19 Dec 2019 05:15:56 +0000 (06:15 +0100)]
iconv tests: Test canonicalized, not system-dependent, encoding names.

* tests/test-iconv.c (main): Revert part of the 2016-08-17 patch.

5 years agolocalename: Fix test failure on AIX 7.2.
Bruno Haible [Thu, 19 Dec 2019 01:06:00 +0000 (02:06 +0100)]
localename: Fix test failure on AIX 7.2.

* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Enable nameless
locales on AIX.
* lib/localename.c (gl_locale_name_thread_unsafe): Handle nameless
locales on AIX.

5 years agoImprove port of AC_C_RESTRICT to Oracle C++
Paul Eggert [Thu, 19 Dec 2019 01:05:02 +0000 (17:05 -0800)]
Improve port of AC_C_RESTRICT to Oracle C++

Problem reported by Christian Biesinger in:
https://lists.gnu.org/r/bug-gnulib/2019-12/msg00159.html
* m4/gnulib-common.m4 (AC_C_RESTRICT): Port better to
Oracle Developer Studio C++ 12.5 or later.

5 years agowchar: Fix test failures on AIX and MSVC (regression from 2019-12-07).
Bruno Haible [Wed, 18 Dec 2019 18:33:27 +0000 (19:33 +0100)]
wchar: Fix test failures on AIX and MSVC (regression from 2019-12-07).

* lib/wchar.in.h (GNULIB_defined_mbstate_t): Do define on AIX and MSVC.

5 years agolocalename: Ensure multithread-safety in future changes.
Bruno Haible [Wed, 18 Dec 2019 16:03:42 +0000 (17:03 +0100)]
localename: Ensure multithread-safety in future changes.

* lib/localename.c (setlocale): Reference the system's setlocale().
(get_locale_t_name): Invoke setlocale_null instead of setlocale.
(gl_locale_name_posix): Likewise.
* modules/localename (Depends-on): Add setlocale-null.

5 years agosetlocale-null: Make API more useful.
Bruno Haible [Wed, 18 Dec 2019 15:30:09 +0000 (16:30 +0100)]
setlocale-null: Make API more useful.

* lib/locale.in.h (setlocale_null_r): Renamed from setlocale_null. All
callers changed.
(setlocale_null): New declaration.
* lib/setlocale_null.c (setlocale_null_androidfix): New function,
extracted from setlocale_null_unlocked.
(setlocale_null_unlocked): Invoke it.
(setlocale_null_r): Renamed from setlocale_null.
(setlocale_null): New function, extracted from setlocale_mtsafe in
setlocale.c.
* lib/setlocale.c: Don't include <errno.h>.
(setlocale_mtsafe): Invoke setlocale_null.
* lib/setlocale-lock.c: Update comments.
* doc/posix-functions/setlocale.texi: Mention both functions.