Bruno Haible [Sun, 12 Jan 2020 23:16:48 +0000 (00:16 +0100)]
c32stombs: New module.
* lib/uchar.in.h (c32stombs): New declaration.
* lib/c32stombs.c: New file.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32STOMBS.
* modules/uchar (Makefile.am): Substitute GNULIB_C32STOMBS.
* modules/c32stombs: New file.
* tests/test-uchar-c++.cc: Test the signature of c32stombs.
* doc/posix-functions/wcstombs.texi: Mention the new module.
Jim Meyering [Sun, 12 Jan 2020 02:59:42 +0000 (18:59 -0800)]
perl: require the "warnings" module
* m4/perl.m4: Also "use warnings", so we reject the perl found
on at least one IRIX 6.5 system. Reported by Bruno Haible in
https://lists.gnu.org/r/sed-devel/2020-01/msg00004.html
Bruno Haible [Fri, 10 Jan 2020 22:29:57 +0000 (23:29 +0100)]
c32snrtombs: Add tests.
* tests/test-c32snrtombs.c: New file, based on tests/test-wcsnrtombs.c.
* tests/test-c32snrtombs-1.sh: New file, based on
tests/test-wcsnrtombs1.sh.
* tests/test-c32snrtombs-2.sh: New file, based on
tests/test-wcsnrtombs2.sh.
* tests/test-c32snrtombs-3.sh: New file, based on
tests/test-wcsnrtombs3.sh.
* tests/test-c32snrtombs-4.sh: New file, based on
tests/test-wcsnrtombs4.sh.
* modules/c32snrtombs-tests: New file, based on
modules/wcsnrtombs-tests.
Bruno Haible [Thu, 9 Jan 2020 15:21:53 +0000 (16:21 +0100)]
c32srtombs: Add tests.
* tests/test-c32srtombs.c: New file, based on tests/test-wcsrtombs.c.
* tests/test-c32srtombs-1.sh: New file, based on
tests/test-wcsrtombs1.sh.
* tests/test-c32srtombs-2.sh: New file, based on
tests/test-wcsrtombs2.sh.
* tests/test-c32srtombs-3.sh: New file, based on
tests/test-wcsrtombs3.sh.
* tests/test-c32srtombs-4.sh: New file, based on
tests/test-wcsrtombs4.sh.
* modules/c32srtombs-tests: New file, based on modules/wcsrtombs-tests.
Bruno Haible [Thu, 9 Jan 2020 15:20:10 +0000 (16:20 +0100)]
c32srtombs: New module.
* lib/uchar.in.h (c32srtombs): New declaration.
* lib/wcsrtombs-impl.h: Parameterize: Use macros FUNC, SCHAR_T,
INTERNAL_STATE, WCRTOMB.
* lib/wcsrtombs.c (FUNC, SCHAR_T, INTERNAL_STATE, WCRTOMB): New macros.
* lib/c32srtombs.c: New file.
* lib/c32srtombs-state.c: New file, based on lib/wcsrtombs-state.c.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32SRTOMBS.
* modules/uchar (Makefile.am): Substitute GNULIB_C32SRTOMBS.
* modules/c32srtombs: New file.
* tests/test-uchar-c++.cc: Test the signature of c32srtombs.
* doc/posix-functions/wcsrtombs.texi: Mention the new module.
Bruno Haible [Thu, 9 Jan 2020 01:04:07 +0000 (02:04 +0100)]
c32tob: Make consistent with mbrtoc32.
* lib/c32tob.c: Include <stdio.h>, <string.h>, <wchar.h>.
(c32tob): If the char32_t encoding and the wchar_t encoding may differ,
use c32rtomb, not wctob.
* modules/c32tob (Files): Add m4/mbrtoc32.m4.
(Depends-on): Add c32rtomb.
(configure.ac): Require gl_MBRTOC32_SANITYCHECK.
Bruno Haible [Thu, 9 Jan 2020 01:00:19 +0000 (02:00 +0100)]
c32rtomb: Add tests.
* tests/test-c32rtomb.c: New file, based on tests/test-wcrtomb.c.
* tests/test-c32rtomb.sh: New file, based on tests/test-wcrtomb.sh.
* tests/test-c32rtomb-w32.c: New file, based on
tests/test-wcrtomb-w32.c.
* tests/test-c32rtomb-w32-1.sh: New file, based on
tests/test-wcrtomb-w32-1.sh.
* tests/test-c32rtomb-w32-2.sh: New file, based on
tests/test-wcrtomb-w32-2.sh.
* tests/test-c32rtomb-w32-3.sh: New file, based on
tests/test-wcrtomb-w32-3.sh.
* tests/test-c32rtomb-w32-4.sh: New file, based on
tests/test-wcrtomb-w32-4.sh.
* tests/test-c32rtomb-w32-5.sh: New file, based on
tests/test-wcrtomb-w32-5.sh.
* tests/test-c32rtomb-w32-6.sh: New file, based on
tests/test-wcrtomb-w32-6.sh.
* tests/test-c32rtomb-w32-7.sh: New file, based on
tests/test-wcrtomb-w32-7.sh.
* modules/c32rtomb-tests: New file.
Bruno Haible [Thu, 9 Jan 2020 00:56:35 +0000 (01:56 +0100)]
c32rtomb: New module.
* lib/uchar.in.h (c32rtomb): New declaration.
* lib/c32rtomb.c: New file, based on lib/unistr/u8-uctomb-aux.c.
* m4/c32rtomb.m4: New file.
* m4/uchar.m4 (gl_UCHAR_H): Test whether c32rtomb is declared.
(gl_UCHAR_H_DEFAULTS): Initialize GNULIB_C32RTOMB, HAVE_C32RTOMB,
REPLACE_C32RTOMB.
* modules/uchar (Makefile.am): Substitute GNULIB_C32RTOMB,
HAVE_C32RTOMB, REPLACE_C32RTOMB.
* modules/c32rtomb: New file.
* tests/test-uchar-c++.cc: Test the signature of c32rtomb.
* doc/posix-functions/c32rtomb.texi: Document the new module.
* doc/posix-functions/wcrtomb.texi: Mention the new module.
Bruno Haible [Thu, 9 Jan 2020 00:47:17 +0000 (01:47 +0100)]
mbrtoc32: Use the system's mbrtoc32 if it exists and basically works.
* m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): New macro.
(gl_FUNC_MBRTOC32): Require it. Set REPLACE_MBRTOC32 if mbrtoc32 exists
but is not working.
* lib/mbrtoc32.c: Include hard-locale.h, <locale.h>.
(mbrtoc32): If the char32_t encoding and the wchar_t encoding may
differ, use the system's mbrtoc32, adding workarounds.
* modules/mbrtoc32 (Depends-on): Add hard-locale.
* doc/posix-functions/mbrtoc32.texi: Mention the Solaris and native
Windows problem.
* lib/btoc32.c: Include <stdio.h>, <string.h>.
(btoc32): If the char32_t encoding and the wchar_t encoding may differ,
use mbrtoc32, not btowc.
* modules/btoc32 (Depends-on): Add mbrtoc32.
* lib/mbsrtoc32s.c (mbsrtoc32s): If the char32_t encoding and the
wchar_t encoding may differ, use mbrtoc32, not mbsrtowcs.
* modules/mbsrtoc32s (Depends-on): Update conditions.
(configure.ac): Compile mbsrtoc32s-state.c unconditionally.
* lib/mbsnrtoc32s.c (mbsnrtoc32s): If the char32_t encoding and the
wchar_t encoding may differ, use mbrtoc32, not mbsnrtowcs.
* modules/mbsnrtoc32s (Depends-on): Update conditions.
(configure.ac): Compile mbsrtoc32s-state.c unconditionally.
Bruno Haible [Wed, 8 Jan 2020 02:32:20 +0000 (03:32 +0100)]
wcrtomb: Make multithread-safe, except possibly on IRIX.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Don't set REPLACE_WCRTOMB to 1 when
REPLACE_MBSTATE_T is set. Define WCRTOMB_C_LOCALE_BUG and
WCRTOMB_RETVAL_BUG.
* lib/wcrtomb.c (wcrtomb): Use original wcrtomb whenever available. Use
wctomb only on IRIX.
Jim Meyering [Sun, 5 Jan 2020 18:25:27 +0000 (10:25 -0800)]
tests: skip thread-using tests when threading is disabled
sed's configure.ac specifies gl_DISABLE_THREADS, and that caused three
thread-using gnulib tests to fail. Add an #if-guarded exit (77) to each
of those, so they are skipped in this case.
* tests/test-nl_langinfo-mt.c (main): Exit 77 when threading is disabled.
* tests/test-setlocale_null-mt-all.c (main): Likewise.
* tests/test-setlocale_null-mt-one.c (main): Likewise.
Bruno Haible [Sun, 5 Jan 2020 08:13:25 +0000 (09:13 +0100)]
tests: Avoid GCC over-optimization caused by _GL_ARG_NONNULL attributes.
Reported by Jim Meyering in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00040.html>.
* lib/stdlib.in.h (GNULIB_defined_canonicalize_file_name): New macro.
(GNULIB_defined_ptsname_r): New macro.
* tests/test-canonicalize.c (_GL_ARG_NONNULL): Define to empty.
(main): Disable the NULL argument test if canonicalize_file_name does
not come from gnulib.
* tests/test-canonicalize-lgpl.c (_GL_ARG_NONNULL): Define to empty.
(main): Disable the NULL argument test if canonicalize_file_name does
not come from gnulib.
* tests/test-ptsname_r.c (_GL_ARG_NONNULL): Define to empty.
(test_errors): Disable the NULL argument test if ptsname_r does not come
from gnulib.
Jim Meyering [Sun, 5 Jan 2020 06:52:20 +0000 (22:52 -0800)]
update-copyright: reenable its always-skipped test
* tests/test-update-copyright.sh: Restore the "-pi" options removed
on 2019-06-15. Without those, an internal preliminary test would
fail, causing this test always to be skipped.
Verify that the test is now run and passes via this:
./gnulib-tool --test --dir /tmp/x --with-tests update-copyright
Bruno Haible [Sun, 5 Jan 2020 11:23:37 +0000 (12:23 +0100)]
mbstoc32s: Add tests.
* tests/test-mbstoc32s.c: New file, based on tests/test-mbsrtoc32s.c.
* tests/test-mbstoc32s-1.sh: New file, based on
tests/test-mbsrtoc32s-1.sh.
* tests/test-mbstoc32s-2.sh: New file, based on
tests/test-mbsrtoc32s-2.sh.
* tests/test-mbstoc32s-3.sh: New file, based on
tests/test-mbsrtoc32s-3.sh.
* tests/test-mbstoc32s-4.sh: New file, based on
tests/test-mbsrtoc32s-4.sh.
* modules/mbstoc32s-tests: New file, based on modules/mbsrtoc32s-tests.
Bruno Haible [Sun, 5 Jan 2020 11:23:00 +0000 (12:23 +0100)]
mbstoc32s: New module.
* lib/uchar.in.h (mbstoc32s): New declaration.
* lib/mbstoc32s.c: New file.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSTOC32S.
* modules/uchar (Makefile.am): Substitute GNULIB_MBSTOC32S.
* modules/mbstoc32s: New file.
* tests/test-uchar-c++.cc: Test the signature of mbstoc32s.
* doc/posix-functions/mbstowcs.texi: Mention the new module.
Bruno Haible [Sun, 5 Jan 2020 01:33:40 +0000 (02:33 +0100)]
mbsnrtoc32s: Add tests.
* tests/test-mbsnrtoc32s.c: New file, based on tests/test-mbsnrtowcs.c.
* tests/test-mbsnrtoc32s-1.sh: New file, based on
tests/test-mbsnrtowcs1.sh.
* tests/test-mbsnrtoc32s-2.sh: New file, based on
tests/test-mbsnrtowcs2.sh.
* tests/test-mbsnrtoc32s-3.sh: New file, based on
tests/test-mbsnrtowcs3.sh.
* tests/test-mbsnrtoc32s-4.sh: New file, based on
tests/test-mbsnrtowcs4.sh.
* modules/mbsnrtoc32s-tests: New file, based on
modules/mbsnrtowcs-tests.
Bruno Haible [Sat, 4 Jan 2020 15:03:10 +0000 (16:03 +0100)]
mbsrtoc32s: Add tests.
* tests/test-mbsrtoc32s.c: New file, based on tests/test-mbsrtowcs.c.
* tests/test-mbsrtoc32s-1.sh: New file, based on
tests/test-mbsrtowcs1.sh.
* tests/test-mbsrtoc32s-2.sh: New file, based on
tests/test-mbsrtowcs2.sh.
* tests/test-mbsrtoc32s-3.sh: New file, based on
tests/test-mbsrtowcs3.sh.
* tests/test-mbsrtoc32s-4.sh: New file, based on
tests/test-mbsrtowcs4.sh.
* modules/mbsrtoc32s-tests: New file, based on modules/mbsrtowcs-tests.
Bruno Haible [Sat, 4 Jan 2020 15:02:31 +0000 (16:02 +0100)]
mbsrtoc32s: New module.
* lib/uchar.in.h (mbsrtoc32s): New declaration.
* lib/mbsrtowcs-impl.h: Parameterize: Use macros FUNC, DCHAR_T,
INTERNAL_STATE, MBRTOWC.
* lib/mbsrtowcs.c (FUNC, DCHAR_T, INTERNAL_STATE, MBRTOWC): New macros.
* lib/mbsrtoc32s.c: New file.
* lib/mbsrtoc32s-state.c: New file, based on lib/mbsrtowcs-state.c.
* m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Initialize GNULIB_MBSRTOC32S.
* modules/uchar (Makefile.am): Substitute GNULIB_MBSRTOC32S.
* modules/mbsrtoc32s: New file.
* tests/test-uchar-c++.cc: Test the signature of mbsrtoc32s.
* doc/posix-functions/mbsrtowcs.texi: Mention the new module.
Bruno Haible [Sat, 4 Jan 2020 14:54:02 +0000 (15:54 +0100)]
mbrtowc, mbrtoc32: Tighten dependendies.
* modules/mbrtowc (Depends-on): Disable hard-locale, mbsinit if
REPLACE_MBSTATE_T is 1.
(configure.ac): Don't compile lc-charset-dispatch.c and mbtowc-lock.c if
REPLACE_MBSTATE_T is 0.
* modules/mbrtoc32 (Depends-on): Remove hard-locale, mbsinit. Disable
mbrtowc dependency if REPLACE_MBSTATE_T is 1.
(configure.ac): Don't compile lc-charset-dispatch.c and mbtowc-lock.c if
REPLACE_MBSTATE_T is 0.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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).
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.
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.
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.
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.