]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 years agoparse-datetime: allow calculations to yield -1
Paul Eggert [Sat, 5 Feb 2022 19:05:44 +0000 (11:05 -0800)]
parse-datetime: allow calculations to yield -1

Problem reported by Jeremy Cantrell <https://bugs.gnu.org/50115>.
* lib/parse-datetime.y (parse_datetime_body): When calling mktime,
use an unmodifed and negative tm_wday or tm_yday to detect an error,
as a (time_t) -1 return value is valid on most hosts.
* tests/test-parse-datetime.c (main): Add a test for the bug.

2 years agomaint: fix up stale XARGCASEMATCH comment
Pádraig Brady [Sun, 30 Jan 2022 12:14:24 +0000 (12:14 +0000)]
maint: fix up stale XARGCASEMATCH comment

* lib/argmatch.c: Remove reference to no longer available macro.

2 years agomaintainer-makefile: fix sc_error_message_uppercase false failure
Pádraig Brady [Fri, 28 Jan 2022 14:54:00 +0000 (14:54 +0000)]
maintainer-makefile: fix sc_error_message_uppercase false failure

* top/maint.mk (sc_error_message_uppercase): Don't trigger for
any of the PRI... defines.  Note we add an extra constraint
here that PRI always follows a double quote, but that's
almost always the case, or can be easily made so by prepending
"" for example.

2 years agomaint: Update copyright notices
Paul Eggert [Thu, 27 Jan 2022 18:57:02 +0000 (10:57 -0800)]
maint: Update copyright notices

* build-aux/announce-gen, build-aux/declared.sh:
* build-aux/git-version-gen, build-aux/gitlog-to-changelog:
* build-aux/gnu-web-doc-update, build-aux/gnupload:
* build-aux/increment-serial, build-aux/libtool-next-version:
* build-aux/useless-if-before-free:
Update some copyright notices by hand, that were not
updated automatically.

2 years agocalloc-gnu: fix misspelling in 2022-01-03 patch
Paul Eggert [Thu, 27 Jan 2022 07:00:41 +0000 (23:00 -0800)]
calloc-gnu: fix misspelling in 2022-01-03 patch

Problem reported by Thien-Thi Nguyen in:
https://lists.gnu.org/r/bug-gnulib/2022-01/msg00170.html
* modules/calloc-gnu (Depends-on):
* modules/calloc-posix (Depends-on):
Fix misspelling of REPLACE_CALLOC_FOR_CALLOC_POSIX.

2 years agoxstrtoimax, xstrtoumax: depend on inttypes-incomplete
Paul Eggert [Mon, 24 Jan 2022 05:07:39 +0000 (21:07 -0800)]
xstrtoimax, xstrtoumax: depend on inttypes-incomplete

This fixes a call to strtoimax without declaring it,
and similarly for strtoumax.
* lib/xstrtoimax.c, lib/xstrtoumax.c (XSTRTOL_INCLUDE_INTTYPES_H):
Define, so that strtoimax and strtoumax are declared.
* lib/xstrtol.c [XSTRTOL_INCLUDE_INTTYPES_H]: Include inttypes.h.
* modules/xstrtoimax, modules/xstrtoumax (Depends-on):
Add inttypes-incomplete.

2 years agoautoupdate
Karl Berry [Wed, 19 Jan 2022 19:00:03 +0000 (11:00 -0800)]
autoupdate

2 years agolog tests: Avoid test failure with nvc 22.1.
Bruno Haible [Sat, 15 Jan 2022 22:39:23 +0000 (23:39 +0100)]
log tests: Avoid test failure with nvc 22.1.

* tests/test-log.h (test_function): With nvc, expect up to 4 ulps error.

2 years agohavelib: Recognize ELF platform despite nvc 22.1.
Bruno Haible [Sat, 15 Jan 2022 22:08:47 +0000 (23:08 +0100)]
havelib: Recognize ELF platform despite nvc 22.1.

* m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): Recognize Linux as an ELF
platform, even with a compiler that does not define __ELF__.

2 years agooset-c++: Avoid compilation error with nvc++ 22.1.
Bruno Haible [Sat, 15 Jan 2022 18:52:28 +0000 (19:52 +0100)]
oset-c++: Avoid compilation error with nvc++ 22.1.

* lib/gl_oset.hh: With EDG C++ compilers, avoid 'friend'.

2 years agointprops: work around nvc 22.1 bug
Paul Eggert [Sat, 15 Jan 2022 02:50:48 +0000 (18:50 -0800)]
intprops: work around nvc 22.1 bug

Problem reported by Olivier Cessenat (Bug#53256).
* lib/intprops.h (_GL_HAS_BUILTIN_ADD_OVERFLOW) [__EDG__]:
Define to 0, since __builtin_add_overflow doesn’t work
on NVIDIA HPC SDK 22.1.

2 years agocopy-file-range: work around Linux kernel bug
Paul Eggert [Sat, 15 Jan 2022 01:27:51 +0000 (17:27 -0800)]
copy-file-range: work around Linux kernel bug

This workaround is adapted from Coreutils.
* lib/copy-file-range.c [__linux__ && HAVE_COPY_FILE_RANGE]:
Include <sys/utsname.h>.
(copy_file_range): Use a stub to replace the copy_file_range of
Linux kernel versions 4.5 through 5.2.
* lib/unistd.in.h (copy_file_range):
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS):
* modules/copy-file-range (configure.ac):
* modules/unistd (unistd.h):
Support replacement of copy_file_range.
* m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE):
Define HAVE_COPY_FILE_RANGE if the system has copy_file_range,
and on Linux check whether the system’s is known to work.

2 years agoautoupdate
Karl Berry [Thu, 13 Jan 2022 17:12:18 +0000 (09:12 -0800)]
autoupdate

2 years agoAvoid warning "_GL_ATTRIBUTE_DEALLOC_FREE redefined" (regr. 2022-01-04).
Bruno Haible [Thu, 13 Jan 2022 15:23:21 +0000 (16:23 +0100)]
Avoid warning "_GL_ATTRIBUTE_DEALLOC_FREE redefined" (regr. 2022-01-04).

Reported by Werner Lemberg <wl@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-01/msg00094.html>.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Avoid redefining
_GL_ATTRIBUTE_DEALLOC_FREE.

2 years agobackupfile: fix bug when renaming not from wd
Paul Eggert [Mon, 10 Jan 2022 18:34:09 +0000 (10:34 -0800)]
backupfile: fix bug when renaming not from wd

* lib/backupfile.c (backupfile_internal): Fix bug when DIR_FD
does not specify the working directory, and when RENAME.
Without the bug fix, FILE is treated as relative to the working
directory, not relative to DIR_FD, when renaming FILE.
This bug was introduced when DIR_FD and RENAME were introduced,
in 2018-10-24T02:10:21Z!eggert@cs.ucla.edu.
While we’re at it, when SDIR is nonnegative improve performance a
bit by passing an SDIR-relative old name to renameatu.

2 years agoautoupdate
Karl Berry [Mon, 10 Jan 2022 14:43:19 +0000 (06:43 -0800)]
autoupdate

2 years agohost-cpu-c-abi: Add support for LoongArch64 CPU.
Bruno Haible [Sun, 9 Jan 2022 23:24:33 +0000 (00:24 +0100)]
host-cpu-c-abi: Add support for LoongArch64 CPU.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Define __loongarch64__. (GCC
and clang predefine only __loongarch__, __loongarch64.)

2 years agognulib-tool: Fix "Don't forget" messages (regression 2021-12-12).
Bruno Haible [Sat, 8 Jan 2022 22:28:29 +0000 (23:28 +0100)]
gnulib-tool: Fix "Don't forget" messages (regression 2021-12-12).

* gnulib-tool (func_import): Fix variable references in "Don't forget"
messages.

2 years agosigsegv: Improve support for Linux/LoongArch64.
Bruno Haible [Fri, 7 Jan 2022 18:11:25 +0000 (19:11 +0100)]
sigsegv: Improve support for Linux/LoongArch64.

* lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER): Add special case for
Linux/LoongArch.

2 years agostring, wchar: Fix compilation error on MSVC (regression 2021-09-07).
Bruno Haible [Tue, 4 Jan 2022 12:20:55 +0000 (13:20 +0100)]
string, wchar: Fix compilation error on MSVC (regression 2021-09-07).

* lib/string.in.h (free): Don't redeclare as rpl_free. Instead, redefine
_GL_ATTRIBUTE_DEALLOC_FREE to reference rpl_free directly.
* lib/wchar.in.h (free): Likewise.

2 years agogetpass-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 15:34:39 +0000 (16:34 +0100)]
getpass-gnu: Allow use as dependency from test modules.

* m4/getpass.m4 (gl_FUNC_GETPASS_GNU): Set
REPLACE_GETPASS_FOR_GETPASS_GNU instead of REPLACE_GETPASS.
* m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Initialize the
getpass-gnu module indicator.
(gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETPASS_FOR_GETPASS_GNU.
* modules/unistd (Makefile.am): Substitute GNULIB_GETPASS_GNU,
REPLACE_GETPASS_FOR_GETPASS_GNU.
* modules/getpass-gnu (configure.ac): Test
REPLACE_GETPASS_FOR_GETPASS_GNU instead of REPLACE_GETPASS. Set a module
indicator.
* lib/unistd.in.h (getpass): Test REPLACE_GETPASS,
REPLACE_GETPASS_FOR_GETPASS_GNU, and the respective module indicators
instead of just REPLACE_GETPASS.

2 years agofopen-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 15:17:18 +0000 (16:17 +0100)]
fopen-gnu: Allow use as dependency from test modules.

* m4/fopen.m4 (gl_FUNC_FOPEN_GNU): Set REPLACE_FOPEN_FOR_FOPEN_GNU
instead of REPLACE_FOPEN.
* m4/stdio_h.m4 (gl_STDIO_H_REQUIRE_DEFAULTS): Initialize the fopen-gnu
module indicator.
(gl_STDIO_H_DEFAULTS): Initialize REPLACE_FOPEN_FOR_FOPEN_GNU.
* modules/stdio (Makefile.am): Substitute GNULIB_FOPEN_GNU,
REPLACE_FOPEN_FOR_FOPEN_GNU.
* modules/fopen-gnu (Depends-on): Add more dependencies.
(configure.ac): Test REPLACE_FOPEN_FOR_FOPEN_GNU instead of
REPLACE_FOPEN.
* lib/stdio.in.h (fopen): Test REPLACE_FOPEN,
REPLACE_FOPEN_FOR_FOPEN_GNU, and the respective module indicators
instead of just REPLACE_FOPEN.

2 years agorealloc-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 14:31:53 +0000 (15:31 +0100)]
realloc-gnu: Allow use as dependency from test modules.

* m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Set
REPLACE_REALLOC_FOR_REALLOC_GNU instead of REPLACE_REALLOC.
(gl_FUNC_REALLOC_POSIX): Set REPLACE_REALLOC_FOR_REALLOC_POSIX instead
of REPLACE_REALLOC.
* m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the
realloc-gnu module indicator.
(gl_STDLIB_H_DEFAULTS): Initialize REPLACE_REALLOC_FOR_REALLOC_GNU,
REPLACE_REALLOC_FOR_REALLOC_POSIX, not REPLACE_REALLOC.
* modules/stdlib (Makefile.am): Substitute GNULIB_REALLOC_GNU,
REPLACE_REALLOC_FOR_REALLOC_GNU, REPLACE_REALLOC_FOR_REALLOC_POSIX, not
REPLACE_REALLOC.
* modules/realloc-posix (Depends-on, configure.ac): Test
REPLACE_REALLOC_FOR_REALLOC_POSIX instead of REPLACE_REALLOC.
* modules/realloc-gnu (Comment): Remove section.
(Depends-on): Add free-posix, malloc-gnu, xalloc-oversized.
(configure.ac): Test REPLACE_REALLOC_FOR_REALLOC_GNU instead of
REPLACE_REALLOC. Set a module indicator.
* lib/stdlib.in.h (realloc): Test REPLACE_REALLOC_FOR_REALLOC_POSIX,
REPLACE_REALLOC_FOR_REALLOC_GNU, and the respective module indicators
instead of just REPLACE_REALLOC.

2 years agocalloc-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 14:17:02 +0000 (15:17 +0100)]
calloc-gnu: Allow use as dependency from test modules.

* m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Set REPLACE_CALLOC_FOR_CALLOC_GNU
instead of REPLACE_CALLOC.
(gl_FUNC_CALLOC_POSIX): Set REPLACE_CALLOC_FOR_CALLOC_POSIX instead of
REPLACE_CALLOC.
* m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the
calloc-gnu module indicator.
(gl_STDLIB_H_DEFAULTS): Initialize REPLACE_CALLOC_FOR_CALLOC_GNU,
REPLACE_CALLOC_FOR_CALLOC_POSIX, not REPLACE_CALLOC.
* modules/stdlib (Makefile.am): Substitute GNULIB_CALLOC_GNU,
REPLACE_CALLOC_FOR_CALLOC_GNU, REPLACE_CALLOC_FOR_CALLOC_POSIX, not
REPLACE_CALLOC.
* modules/calloc-posix (Depends-on, configure.ac): Test
REPLACE_CALLOC_FOR_CALLOC_POSIX instead of REPLACE_CALLOC.
* modules/calloc-gnu (Depends-on): Add xalloc-oversized.
(configure.ac): Test REPLACE_CALLOC_FOR_CALLOC_GNU instead of
REPLACE_CALLOC. Set a module indicator.
* lib/stdlib.in.h (calloc): Test REPLACE_CALLOC_FOR_CALLOC_POSIX,
REPLACE_CALLOC_FOR_CALLOC_GNU, and the respective module indicators
instead of just REPLACE_CALLOC.

2 years agomalloc-gnu: Allow use as dependency from test modules.
Bruno Haible [Mon, 3 Jan 2022 13:49:04 +0000 (14:49 +0100)]
malloc-gnu: Allow use as dependency from test modules.

* m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Set REPLACE_MALLOC_FOR_MALLOC_GNU
instead of REPLACE_MALLOC.
(gl_FUNC_MALLOC_PTRDIFF, gl_FUNC_MALLOC_POSIX): Set
REPLACE_MALLOC_FOR_MALLOC_POSIX instead of REPLACE_MALLOC.
* m4/calloc.m4 (gl_FUNC_CALLOC_POSIX): Test
REPLACE_MALLOC_FOR_MALLOC_POSIX instead of REPLACE_MALLOC.
* m4/realloc.m4 (gl_FUNC_REALLOC_POSIX): Likewise.
* m4/stdlib_h.m4 (gl_STDLIB_H_REQUIRE_DEFAULTS): Initialize the
malloc-gnu module indicator.
(gl_STDLIB_H_DEFAULTS): Initialize REPLACE_MALLOC_FOR_MALLOC_GNU,
REPLACE_MALLOC_FOR_MALLOC_POSIX, not REPLACE_MALLOC.
* modules/stdlib (Makefile.am): Substitute GNULIB_MALLOC_GNU,
REPLACE_MALLOC_FOR_MALLOC_GNU, REPLACE_MALLOC_FOR_MALLOC_POSIX, not
REPLACE_MALLOC.
* modules/malloc-posix (Depends-on, configure.ac): Test
REPLACE_MALLOC_FOR_MALLOC_POSIX instead of REPLACE_MALLOC.
* modules/malloc-gnu (Comment): Remove section.
(Depends-on): Add xalloc-oversized.
(configure.ac): Test REPLACE_MALLOC_FOR_MALLOC_GNU instead of
REPLACE_MALLOC. Set a module indicator.
* lib/stdlib.in.h (malloc): Test REPLACE_MALLOC_FOR_MALLOC_POSIX,
REPLACE_MALLOC_FOR_MALLOC_GNU, and the respective module indicators
instead of just REPLACE_MALLOC.

2 years agogen-header: port to BusyBox ‘sed’
Paul Eggert [Sat, 1 Jan 2022 23:30:38 +0000 (15:30 -0800)]
gen-header: port to BusyBox ‘sed’

Problem reported by Tim Rühsen in:
https://lists.gnu.org/r/bug-gnulib/2022-01/msg00004.html
* modules/gen-header (SED_HEADER_NOEDIT): Replace instead of prepend.
(SED_HEADER_STDOUT, SED_HEADER_TO_AT_t): Adjust to that change.
Do not use ‘w foo’ twice in the same script, as BusyBox ‘sed’
mistakenly opens ‘foo’ for output twice, thus losing some output.

2 years agoautoupdate
Paul Eggert [Sat, 1 Jan 2022 20:05:00 +0000 (12:05 -0800)]
autoupdate

3 years agomaint: Update copyright notices.
Bruno Haible [Sat, 1 Jan 2022 18:48:46 +0000 (19:48 +0100)]
maint: Update copyright notices.

* build-aux/declared.sh (func_version): Bump year.

3 years agomaint: Update copyright notices in code generating programs.
Bruno Haible [Sat, 1 Jan 2022 18:48:03 +0000 (19:48 +0100)]
maint: Update copyright notices in code generating programs.

* lib/gen-uni-tables.c (output_predicate_test, output_predicate,
output_category, output_combclass, output_bidi_category,
output_decimal_digit_test, output_decimal_digit, output_digit_test,
output_digit, output_numeric_test, output_numeric, output_mirror,
output_joining_type_test, output_joining_type,
output_joining_group_test, output_joining_group, output_scripts,
output_scripts_byname, output_blocks, output_ident_category,
output_nonspacing_property, output_lbrk_tables,
output_lbrk_rules_as_tables, output_wbrk_tables, output_gbp_test,
output_gbp_table, output_decomposition_tables,
output_composition_tables, output_simple_mapping_test,
output_simple_mapping, output_casing_rules): Extend copyright year of
generated file to 2022.
* lib/uniname/gen-uninames.lisp (main): Likewise. Produce license notice
that is consistent with the gnulib/etc/license-notices/ files.
* All files regenerated.

3 years agomaint: fix ‘make update-copyright’ on symlinks
Paul Eggert [Sat, 1 Jan 2022 18:24:28 +0000 (10:24 -0800)]
maint: fix ‘make update-copyright’ on symlinks

After running ‘make update-copyright’ I noticed that it
incorrectly replaced a couple of symlinks with their contents.
* Makefile (update-copyright): Do not update symlinks.
* etc/license-notices/GPL, etc/license-notices/LGPL:
Change these back to symlinks.

3 years agomaint: run 'make update-copyright'
Paul Eggert [Sat, 1 Jan 2022 17:43:19 +0000 (09:43 -0800)]
maint: run 'make update-copyright'

3 years agounistdio: Prefer newer version to older, buggy one.
Bruno Haible [Fri, 31 Dec 2021 23:44:56 +0000 (00:44 +0100)]
unistdio: Prefer newer version to older, buggy one.

* modules/unistdio/ulc-vasnprintf (configure.ac): Bump required
libunistring version. This is needed because of the heap overrun fix
(2018-09-23) and the need to avoid %n on more platforms (2020-10-04).
* modules/unistdio/ulc-asnprintf (configure.ac): Likewise.
* modules/unistdio/ulc-asprintf (configure.ac): Likewise.
* modules/unistdio/ulc-fprintf (configure.ac): Likewise.
* modules/unistdio/ulc-snprintf (configure.ac): Likewise.
* modules/unistdio/ulc-sprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vasprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vfprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vsnprintf (configure.ac): Likewise.
* modules/unistdio/ulc-vsprintf (configure.ac): Likewise.

3 years agouniwidth: Optimize.
Bruno Haible [Fri, 31 Dec 2021 22:53:39 +0000 (23:53 +0100)]
uniwidth: Optimize.

* lib/gen-uni-tables.c (output_nonspacing_property): Add version
parameter. Emit the usual boilerplate header for generated files.
(is_width2): New function, based on lib/uniwidth/width.c.
(output_width2_property): New function.
(main): Create uniwidth/width0.h instead of uniwidth/width.c.part.
Create uniwidth/width2.h.
* lib/uniwidth/width.c: Include width0.h, width2.h, bitmap.h.
(nonspacing_table_data, nonspacing_table_ind): Remove here.
(uc_width): Replace the double-width character with an u_width2 bitmap
lookup.
* modules/uniwidth/width (Files): Add lib/uniwidth/width0.h,
lib/uniwidth/width2.h, lib/unictype/bitmap.h.

3 years agoUpdate to Unicode 14.0.0.
Bruno Haible [Fri, 31 Dec 2021 17:38:12 +0000 (18:38 +0100)]
Update to Unicode 14.0.0.

* lib/gen-uni-tables.c (UC_JOINING_GROUP_THIN_YEH,
UC_JOINING_GROUP_VERTICAL_TAIL): New enum values.
(fill_arabicshaping, joining_group_as_c_identifier): Recognize these
joining groups.
* lib/unictype.in.h (UC_JOINING_GROUP_THIN_YEH,
UC_JOINING_GROUP_VERTICAL_TAIL): New enum values.
* lib/unictype/joininggroup_name.h: Add the THIN_YEH, VERTICAL_TAIL
joining groups.
* lib/unictype/joininggroup_byname.gperf: Likewise.

* lib/gen-uni-tables.c (LBP_ID1, LBP_ID2): New enum values.
(LBP_ID): Assign artificial value.
(get_lbp): Use the extended_pictographic property to assign LBP_ID1,
LBP_ID2 instead of LBP_ID. Update such that unilbrk/lbrkprop.txt comes
out as expected.
(debug_output_lbp): Print either LBP_ID1 or LBP_ID2 as LBP_ID.
(lbp_value_to_string): Handle LBP_ID1, LBP_ID2 instead of LBP_ID.
(output_lbrk_rules_as_tables): Treat LBP_ID as macro that maps to two
table rows/columns. In rule LB30b, use LBP_ID2 in addition to LBP_EB.
Remove redundant part of rule LB27.
* lib/unilbrk/lbrktables.h (LBP_ID1, LBP_ID2): New enum values.
(LBP_ID): Remove enum value.
(unilbrk_table): Update declaration.
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Use LBP_ID1 instead of LBP_ID.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.
* tests/unilbrk/test-u8-possible-linebreaks.c (test_function): Add a
test of potential future emoji.
* tests/unilbrk/test-u16-possible-linebreaks.c (test_function):
Likewise.
* tests/unilbrk/test-u32-possible-linebreaks.c (test_function):
Likewise.

* lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind):
Update.
(uc_width): Assign width 2 to the characters 0x1AFF0..0x1AFF3,
0x1AFF5..0x1AFFB, 0x1AFFD..0x1AFFE, 0x1B120..0x1B122, 0x1F6DD..0x1F6DF,
0x1F7F0, 0x1FA7B..0x1FA7C, 0x1FAA9..0x1FAAC, 0x1FAB7..0x1FABA,
0x1FAC3..0x1FAC5, 0x1FAD7..0x1FAD9, 0x1FAE0..0x1FAE7, 0x1FAF0..0x1FAF6.
* tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters
0x0890..0x0891, 0x0898..0x089F, 0x08CA..0x0902, 0x0C3C, 0x180F,
0x1AC1..0x1ACE, 0x1DFA, 0x10F82..0x10F85, 0x11070, 0x11073..0x11074,
0x110C2, 0x1CF00..0x1CF2D, 0x1CF30..0x1CF46, 0x1E2AE. Expect ambiguous
width for the character 0x1734. Expect width 2 for the characters
0x1AFF0..0x1AFF3, 0x1AFF5..0x1AFFB, 0x1AFFD..0x1AFFE, 0x1B120..0x1B122,
0x1F6DD..0x1F6DF, 0x1F7F0, 0x1FA7B..0x1FA7C, 0x1FAA9..0x1FAAC,
0x1FAB7..0x1FABA, 0x1FAC3..0x1FAC5, 0x1FAD7..0x1FAD9, 0x1FAE0..0x1FAE7,
0x1FAF0..0x1FAF6.

* All generated files under lib/uni* and tests/uni*: Regenerate.
* tests/uniname/NameAliases.txt: Update.
* tests/uniname/UnicodeData.txt: Update.
* tests/uninorm/NormalizationTest.txt: Update.
* tests/unigbrk/GraphemeBreakTest.txt: Update.
* tests/uniwbrk/WordBreakTest.txt: Update.

* All the affected modules: Bump required libunistring version.

3 years agoCorrect last ChangeLog entry.
Bruno Haible [Fri, 31 Dec 2021 17:15:02 +0000 (18:15 +0100)]
Correct last ChangeLog entry.

* tests/unilbrk/test-u8-possible-linebreaks.c (test_function): Add a
test for East Asian opening parenthesis.
* tests/unilbrk/test-u16-possible-linebreaks.c (test_function):
Likewise.
* tests/unilbrk/test-u32-possible-linebreaks.c (test_function):
Likewise.

3 years agoUpdate to Unicode 13.0.0.
Bruno Haible [Fri, 31 Dec 2021 11:20:27 +0000 (12:20 +0100)]
Update to Unicode 13.0.0.

* lib/gen-uni-tables.c (is_WBP_MIDLETTER): Add character 0x055F.
(get_wbp): Assign value WBP_ALETTER to the characters 0x02E5..0x02EB,
0x055A, 0x058A, 0xA708..0xA716.

* lib/gen-uni-tables.c (LBP_CP1, LBP_CP2, LBP_OP1, LBP_OP2): New enum
values.
(LBP_OP, LBP_CP): Assign artificial values.
(get_lbp): Use the unicode_width[] table to assign LBP_CP1, LBP_CP2
instead of LBP_CP, and LBP_OP1, LBP_OP2 instead of LBP_OP. Update such
that unilbrk/lbrkprop.txt comes out as expected.
(debug_output_lbp): Print either LBP_CP1 or LBP_CP2 as LBP_CP. Print
either LBP_OP1 or LBP_OP2 as LBP_OP.
(lbp_value_to_string): Handle LBP_CP1, LBP_CP2, LBP_OP1, LBP_OP2 instead
of LBP_CP, LBP_OP.
(output_lbrk_rules_as_tables): Treat LBP_CP and LBP_OP as macros that
map to two table rows/columns. In rule LB30, use only LBP_OP1 instead of
LBP_OP, and only LBP_CP1 instead of LBP_CP. Simplify rule LB22.
* lib/unilbrk/lbrktables.h (LBP_CP1, LBP_CP2, LBP_OP1, LBP_OP2): New
enum values.
(LBP_OP, LBP_CP): Remove enum values.
(unilbrk_table): Update declaration.
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Add a test for East Asian opening parenthesis.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.

* lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind):
Update.
(uc_width): Assign width 2 to the characters 0x16FF0..0x16FF1,
0x18AF3..0x18CD5, 0x18D00..0x18D08, 0x1F6D6..0x1F6D7, 0x1F6FB..0x1F6FC,
0x1F90C, 0x1FA74, 0x1FA83..0x1FA86, 0x1FA96..0x1FAA8, 0x1FAB0..0x1FAB6,
0x1FAC0..0x1FAC2, 0x1FAD0..0x1FAD6.
Assign width 1 to the characters 0x1F93B, 0x1F946.
* tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters
0x0B55, 0x0D81, 0x1ABF..0x1AC0, 0xA82C, 0x10EAB..0x10EAC, 0x111CF,
0x1193B..0x1193C, 0x1193E, 0x11943, 0x16FE4. Expect width 2 for the
characters 0x16FF0..0x16FF1, 0x18AF3..0x18CD5, 0x18D00..0x18D08,
0x1F6D6..0x1F6D7, 0x1F6FB..0x1F6FC, 0x1F90C, 0x1FA74, 0x1FA83..0x1FA86,
0x1FA96..0x1FAA8, 0x1FAB0..0x1FAB6, 0x1FAC0..0x1FAC2, 0x1FAD0..0x1FAD6.
Expect width 1 for the characters 0x1F93B, 0x1F946.

* All generated files under lib/uni* and tests/uni*: Regenerate.
* tests/uniname/NameAliases.txt: Update.
* tests/uniname/UnicodeData.txt: Update.
* tests/uninorm/NormalizationTest.txt: Update.
* tests/unigbrk/GraphemeBreakTest.txt: Update.
* tests/uniwbrk/WordBreakTest.txt: Update.

* All the affected modules: Bump required libunistring version.

3 years agouniwbrk: Correction of Unicode 10.0.0 support.
Bruno Haible [Thu, 30 Dec 2021 22:12:41 +0000 (23:12 +0100)]
uniwbrk: Correction of Unicode 10.0.0 support.

* lib/gen-uni-tables.c (is_WBP_MIDLETTER): Remove character 0x02D7.
The generated files are not affected.

3 years agoUpdate to Unicode 12.1.0.
Bruno Haible [Thu, 30 Dec 2021 21:38:55 +0000 (22:38 +0100)]
Update to Unicode 12.1.0.

* lib/gen-uni-tables.c: Update comments.

* All generated files under lib/uni* and tests/uni*: Regenerate.
* tests/uniname/NameAliases.txt: Update.
* tests/uniname/UnicodeData.txt: Update.
* tests/uninorm/NormalizationTest.txt: Update.
* tests/unigbrk/GraphemeBreakTest.txt: Update.
* tests/uniwbrk/WordBreakTest.txt: Update.

* All the affected modules: Bump required libunistring version.

3 years agoUpdate to Unicode 12.0.0.
Bruno Haible [Thu, 30 Dec 2021 20:54:23 +0000 (21:54 +0100)]
Update to Unicode 12.0.0.

* lib/gen-uni-tables.c (is_property_default_ignorable_code_point):
Exclude 0x13430..0x13438.
(get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected.
(get_wbp): Map 0xFF10..0xFF19 to WBP_NUMERIC.

* lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind):
Update.
(uc_width): Assign width 2 to the characters 0x16FE2..0x16FE3,
0x187F2..0x187F7, 0x1B150..0x1B152, 0x1B164..0x1B167, 0x1F6D5, 0x1F6FA,
0x1F7E0..0x1F7EB, 0x1F90D..0x1F90F, 0x1FA70..0x1FA73, 0x1FA78..0x1FA7A,
0x1FA80..0x1FA82, 0x1FA90..0x1FA95.
* tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters
0x0EBA, 0xA9BD, 0x119D4..0x119D7, 0x119DA..0x119DB, 0x119E0,
0x13430..0x13438, 0x16F4F, 0x1E130..0x1E136, 0x1E2EC..0x1E2EF. Expect
width 2 for the characters 0x16FE2..0x16FE3, 0x187F2..0x187F7,
0x1B150..0x1B152, 0x1B164..0x1B167, 0x1F6D5, 0x1F6FA, 0x1F7E0..0x1F7EB,
0x1F90D..0x1F90F, 0x1FA70..0x1FA73, 0x1FA78..0x1FA7A, 0x1FA80..0x1FA82,
0x1FA90..0x1FA95.

* All generated files under lib/uni* and tests/uni*: Regenerate.
* tests/uniname/NameAliases.txt: Update.
* tests/uniname/UnicodeData.txt: Update.
* tests/uninorm/NormalizationTest.txt: Update.
* tests/unigbrk/GraphemeBreakTest.txt: Update.
* tests/uniwbrk/WordBreakTest.txt: Update.

* All the affected modules: Bump required libunistring version.

3 years agocrypto/sm3-buffer: fix C99 conformance bug
Paul Eggert [Thu, 30 Dec 2021 19:02:40 +0000 (11:02 -0800)]
crypto/sm3-buffer: fix C99 conformance bug

* lib/sm3.c (sm3_process_block): Call varargs macro with enough
arguments.  Problem found by IBM XL/C 12.1.0.0 for AIX.

3 years agoUpdate to Unicode 11.0.0.
Bruno Haible [Thu, 30 Dec 2021 15:45:39 +0000 (16:45 +0100)]
Update to Unicode 11.0.0.

* lib/gen-uni-tables.c (is_property_default_ignorable_code_point):
Simplify by use of PROP_PREPENDED_CONCATENATION_MARK.
(UC_JOINING_GROUP_HANIFI_ROHINGYA_PA,
UC_JOINING_GROUP_HANIFI_ROHINGYA_KINNA_YA): New enum values.
(fill_arabicshaping, joining_group_as_c_identifier): Recognize these
joining groups.
(get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected.
(WBP_EB, WBP_EM, WBP_GAZ, WBP_EBG): Remove enum values.
(WBP_WSS): New enum value.
(get_wbp): Update such that uniwbrk/wbrkprop.txt comes out as expected.
(debug_output_wbp, fill_org_wbp, debug_output_org_wbp, output_wbp):
Update for changed enum values.

* lib/unictype.in.h (UC_JOINING_GROUP_HANIFI_ROHINGYA_*): New enum
values.
* lib/unictype/joininggroup_name.h: Add the HANIFI_ROHINGYA_* joining
groups.
* lib/unictype/joininggroup_byname.gperf: Likewise.

* lib/unigbrk.in.h: Mark 4 enum values as obsolete.
* lib/unigbrk/u-grapheme-breaks.h (FUNC): Handle emoji modifier sequence
according to Unicode 11.0.0.
* lib/unigbrk/u8-grapheme-breaks.c: Include <stdbool.h>, unictype.h.
* lib/unigbrk/u16-grapheme-breaks.c: Likewise.
* lib/unigbrk/u32-grapheme-breaks.c: Likewise.
* lib/unigbrk/uc-grapheme-breaks.c: Likewise.
* modules/unigbrk/u8-grapheme-breaks (Depends-on): Add
unictype/property-extended-pictographic, stdbool.
* modules/unigbrk/u16-grapheme-breaks (Depends-on): Likewise.
* modules/unigbrk/u32-grapheme-breaks (Depends-on): Likewise.
* modules/unigbrk/uc-grapheme-breaks (Depends-on): Likewise.
* tests/unigbrk/test-u8-grapheme-breaks.c (main): Add test for emoji
modifier / ZWJ sequence.
* tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise.
* tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise.
* tests/unigbrk/test-uc-is-grapheme-break.c: Include <stdbool.h>,
unictype.h.
(main): Update workaround logic to match the one in
lib/unigbrk/u-grapheme-breaks.h.
* modules/unigbrk/uc-is-grapheme-break-tests (Depends-on): Add
unictype/property-extended-pictographic, stdbool.

* lib/uniwbrk.in.h: Mark 4 enum values as obsolete.
(WBP_WSS): New enum value.
* lib/uniwbrk/u-wordbreaks.h (FUNC): Handle emoji ZWJ sequences and
horizontal whitespace according to Unicode 11.0.0.
* lib/uniwbrk/u8-wordbreaks.c: Include unictype.h.
* lib/uniwbrk/u16-wordbreaks.c: Likewise.
* lib/uniwbrk/u32-wordbreaks.c: Likewise.
* lib/uniwbrk/wbrktable.c (uniwbrk_prop_index, uniwbrk_table): Add a row
and column for WBP_WSS.
* lib/uniwbrk/wbrktable.h (uniwbrk_prop_index, uniwbrk_table): Update
declarations.
* modules/uniwbrk/u8-wordbreaks (Depends-on): Add
unictype/property-extended-pictographic.
* modules/uniwbrk/u16-wordbreaks (Depends-on): Likewise.
* modules/uniwbrk/u32-wordbreaks (Depends-on): Likewise.
* tests/uniwbrk/test-u8-wordbreaks.c (main): Update expected results.
* tests/uniwbrk/test-u16-wordbreaks.c (main): Likewise.
* tests/uniwbrk/test-u32-wordbreaks.c (main): Likewise.
* tests/uniwbrk/test-uc-wordbreaks.c (wordbreakproperty_to_string):
Update.

* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Handle ZWJ according to Unicode 11.0.0.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.

* lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind):
Update.
(uc_width): Assign width 2 to the characters 0x187ED..0x187F1, 0x1F6F9,
0x1F9E7..0x1F9FF.
* tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters
0x07FD, 0x08D3, 0x09FE, 0x0C04, 0xA8FF, 0x10D24..0x10D27,
0x10F46..0x10F50, 0x110CD, 0x111C9, 0x1133B, 0x1145E, 0x1182F..0x11837,
0x11839..0x1183A, 0x11D90..0x11D91, 0x11D95, 0x11D97, 0x11EF3..0x11EF4.
Expect width 2 for the characters 0x187ED..0x187F1, 0x1F6F9,
0x1F9E7..0x1F9FF.

* All generated files under lib/uni* and tests/uni*: Regenerate.
* tests/uniname/NameAliases.txt: Update.
* tests/uniname/UnicodeData.txt: Update.
* tests/uninorm/NormalizationTest.txt: Update.
* tests/unigbrk/GraphemeBreakTest.txt: Update.
* tests/uniwbrk/WordBreakTest.txt: Update.

* All the affected modules: Bump required libunistring version.

3 years agounictype: Add Emoji properties from Unicode 11.0.0.
Bruno Haible [Thu, 30 Dec 2021 10:43:09 +0000 (11:43 +0100)]
unictype: Add Emoji properties from Unicode 11.0.0.

* lib/gen-uni-tables.c (PROP_EMOJI*, PROP_EXTENDED_PICTOGRAPHIC): New
enum values.
(fill_properties): Don't require a space between the property name and
the comment. Handle the property names from emoji-data.txt.
(is_property_emoji, is_property_emoji_presentation,
is_property_emoji_modifier, is_property_emoji_modifier_base,
is_property_emoji_component, is_property_extended_pictographic): New
declarations.
(output_properties): Emit the properties emoji, emoji_presentation,
emoji_modifier, emoji_modifier_base, emoji_component,
extended_pictographic.
(get_lbp): Use the emoji_modifier property.
(main): Expect one more argument, for the emoji-data.txt file.
* lib/unictype.in.h (UC_PROPERTY_EMOJI, UC_PROPERTY_EMOJI_PRESENTATION,
UC_PROPERTY_EMOJI_MODIFIER, UC_PROPERTY_EMOJI_MODIFIER_BASE,
UC_PROPERTY_EMOJI_COMPONENT, UC_PROPERTY_EXTENDED_PICTOGRAPHIC,
uc_is_property_emoji, uc_is_property_emoji_presentation,
uc_is_property_emoji_modifier, uc_is_property_emoji_modifier_base,
uc_is_property_emoji_component, uc_is_property_extended_pictographic):
New declarations.
* lib/unictype/pr_emoji.c: New file.
* lib/unictype/pr_emoji_presentation.c: New file.
* lib/unictype/pr_emoji_modifier.c: New file.
* lib/unictype/pr_emoji_modifier_base.c: New file.
* lib/unictype/pr_emoji_component.c: New file.
* lib/unictype/pr_extended_pictographic.c: New file.
* modules/unictype/property-emoji: New file.
* modules/unictype/property-emoji-tests: New file.
* modules/unictype/property-emoji-presentation: New file.
* modules/unictype/property-emoji-presentation-tests: New file.
* modules/unictype/property-emoji-modifier: New file.
* modules/unictype/property-emoji-modifier-tests: New file.
* modules/unictype/property-emoji-modifier-base: New file.
* modules/unictype/property-emoji-modifier-base-tests: New file.
* modules/unictype/property-emoji-component: New file.
* modules/unictype/property-emoji-component-tests: New file.
* modules/unictype/property-extended-pictographic: New file.
* modules/unictype/property-extended-pictographic-tests: New file.
* modules/unictype/property-all (Depends-on): Depend on the new modules.

3 years agouniwidth: Give width 0 to conjoining Hangul Jamo jungseong, jongseong.
Bruno Haible [Thu, 30 Dec 2021 00:09:20 +0000 (01:09 +0100)]
uniwidth: Give width 0 to conjoining Hangul Jamo jungseong, jongseong.

Reported by Luis Javier Merino <ninjalj@gmail.com> in
<https://lists.gnu.org/archive/html/bug-libunistring/2021-12/msg00006.html>.

* lib/gen-uni-tables.c (is_nonspacing): Return true for the conjoining
Hangul Jamo jungseong and jongseong characters.
* lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind):
Regenerated.
* tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters
0x1160..0x11FF, 0xD7B0..0xD7C6, 0xD7CB..0xD7FB.

3 years agouniwidth: Update to Unicode 10.0.0.
Bruno Haible [Wed, 29 Dec 2021 21:34:24 +0000 (22:34 +0100)]
uniwidth: Update to Unicode 10.0.0.

* lib/uniwidth/width.c (uc_width): Assign width 2 to the characters
0x231A..0x231B, 0x23E9..0x23EC, 0x23F0, 0x23F3, 0x25FD..0x25FE,
0x2614..0x2615, 0x2648..0x2653, 0x267F, 0x2693, 0x26A1, 0x26AA..0x26AB,
0x26BD..0x26BE, 0x26C4..0x26C5, 0x26CE, 0x26D4, 0x26EA, 0x26F2..0x26F3,
0x26F5, 0x26FA, 0x26FD, 0x2705, 0x270A..0x270B, 0x2728, 0x274C, 0x274E,
0x2753..0x2755, 0x2757, 0x2795..0x2797, 0x27B0, 0x27BF, 0x2B1B..0x2B1C,
0x2B50, 0x2B55, 0xA960..0xA97C, 0x16FE0..0x16FE1, 0x17000..0x187EC,
0x18800..0x18AF2, 0x1B000..0x1B11F, 0x1B170..0x1B2FB, 0x1F004, 0x1F0CF,
0x1F18E, 0x1F191..0x1F19A, 0x1F200..0x1F320, 0x1F32D..0x1F335,
0x1F337..0x1F37C, 0x1F37E..0x1F393, 0x1F3A0..0x1F3CA, 0x1F3CF..0x1F3D3,
0x1F3E0..0x1F3F0, 0x1F3F4, 0x1F3F8..0x1F43E, 0x1F440, 0x1F442..0x1F4FC,
0x1F4FF..0x1F53D, 0x1F54B..0x1F54E, 0x1F550..0x1F567, 0x1F57A,
0x1F595..0x1F596, 0x1F5A4, 0x1F5FB..0x1F64F, 0x1F680..0x1F6C5, 0x1F6CC,
0x1F6D0..0x1F6D2, 0x1F6EB..0x1F6EC, 0x1F6F4..0x1F6F8, 0x1F910..0x1F9E6.
Assign ambiguous width to the characters 0x3248..0x324F.
* tests/uniwidth/test-uc_width2.sh: Expect these changes.

3 years agounilbrk: Improve support for strings that contain CR-LF sequences.
Bruno Haible [Wed, 29 Dec 2021 18:54:46 +0000 (19:54 +0100)]
unilbrk: Improve support for strings that contain CR-LF sequences.

* lib/gen-uni-tables.c (LBP_CR, LBP_LF): New enum values.
(get_lbp): For '\r' and '\n', return LBP_CR and LBP_LF, respectively,
instead of LBP_BK.
(debug_output_lbp, fill_org_lbp, debug_output_org_lbp,
lbp_value_to_string): Handle LBP_CR, LBP_LF.
* lib/unilbrk/lbrkprop2.h: Regenerated.
* lib/unilbrk/lbrktables.h (LBP_CR, LBP_LF): New enum values.
* lib/unilbrk.in.h (UC_BREAK_CR_BEFORE_LF): New enum value.
(u8_possible_linebreaks, u16_possible_linebreaks,
u32_possible_linebreaks, ulc_possible_linebreaks, u8_width_linebreaks,
u16_width_linebreaks, u32_width_linebreaks, ulc_width_linebreaks):
Declare also a _v2 variant, and use a C macro to activate it by default.
* lib/unilbrk/internal.h: New file.
* lib/unilbrk/u8-possible-linebreaks.c: Include unilbrk/internal.h.
(u8_possible_linebreaks_loop): Renamed from u8_possible_linebreaks. Add
'cr' parameter.
(u8_possible_linebreaks, u8_possible_linebreaks_v2): New functions.
(main): Update.
* lib/unilbrk/u16-possible-linebreaks.c: Include unilbrk/internal.h.
(u16_possible_linebreaks_loop): Renamed from u16_possible_linebreaks.
Add 'cr' parameter.
(u16_possible_linebreaks, u16_possible_linebreaks_v2): New functions.
* lib/unilbrk/u32-possible-linebreaks.c: Include unilbrk/internal.h.
(u32_possible_linebreaks_loop): Renamed from u32_possible_linebreaks.
Add 'cr' parameter.
(u32_possible_linebreaks, u32_possible_linebreaks_v2): New functions.
* lib/unilbrk/ulc-possible-linebreaks.c: Include unilbrk/internal.h,
unilbrk/lbrktables.h.
(ulc_possible_linebreaks_internal): Renamed from
ulc_possible_linebreaks. Add 'cr' parameter.
(ulc_possible_linebreaks, ulc_possible_linebreaks_v2): New functions.
(main): Update.
* lib/unilbrk/u8-width-linebreaks.c: Include unilbrk/internal.h,
unilbrk/lbrktables.h.
(u8_width_linebreaks_internal): Renamed from u8_width_linebreaks. Add
'cr' parameter.
(u8_width_linebreaks, u8_width_linebreaks_v2): New functions.
(main): Update.
* lib/unilbrk/u16-width-linebreaks.c: Include unilbrk/internal.h,
unilbrk/lbrktables.h.
(u16_width_linebreaks_internal): Renamed from u16_width_linebreaks. Add
'cr' parameter.
(u16_width_linebreaks, u16_width_linebreaks_v2): New functions.
* lib/unilbrk/u32-width-linebreaks.c: Include unilbrk/internal.h,
unilbrk/lbrktables.h.
(u32_width_linebreaks_internal): Renamed from u32_width_linebreaks. Add
'cr' parameter.
(u32_width_linebreaks, u32_width_linebreaks_v2): New functions.
* lib/unilbrk/ulc-width-linebreaks.c: Include unilbrk/internal.h,
unilbrk/lbrktables.h.
(ulc_width_linebreaks_internal): Renamed from ulc_width_linebreaks. Add
'cr' parameter.
(ulc_width_linebreaks, ulc_width_linebreaks_v2): New functions.
(main): Update.
* modules/unilbrk/u8-possible-linebreaks (Files): Add
lib/unilbrk/internal.h.
* modules/unilbrk/u16-possible-linebreaks (Files): Likewise.
* modules/unilbrk/u32-possible-linebreaks (Files): Likewise.
* modules/unilbrk/u8-width-linebreaks (Files): Likewise.
* tests/unilbrk/test-u8-possible-linebreaks.c (test_function): New
function, extracted from main. Add a test of CR-LF handling.
(main): Invoke it twice.
* tests/unilbrk/test-u16-possible-linebreaks.c (test_function): New
function, extracted from main. Add a test of CR-LF handling.
(main): Invoke it twice.
* tests/unilbrk/test-u32-possible-linebreaks.c (test_function): New
function, extracted from main. Add a test of CR-LF handling.
(main): Invoke it twice.
* tests/unilbrk/test-ulc-possible-linebreaks.c (test_function): New
function, extracted from main.
(main): Invoke it twice.
* tests/unilbrk/test-u8-width-linebreaks.c (test_function): New
function, extracted from main.
(main): Invoke it twice.
* tests/unilbrk/test-u16-width-linebreaks.c (test_function): New
function, extracted from main.
(main): Invoke it twice.
* tests/unilbrk/test-u32-width-linebreaks.c (test_function): New
function, extracted from main.
(main): Invoke it twice.
* tests/unilbrk/test-ulc-width-linebreaks.c (test_function): New
function, extracted from main.
(main): Invoke it twice.

3 years agouniwbrk: Add unit tests of CR-LF sequences.
Bruno Haible [Wed, 29 Dec 2021 11:15:37 +0000 (12:15 +0100)]
uniwbrk: Add unit tests of CR-LF sequences.

* tests/uniwbrk/test-u8-wordbreaks.c (main): Add test of a string with
CR-LF.
* tests/uniwbrk/test-u16-wordbreaks.c (main): Likewise.
* tests/uniwbrk/test-u32-wordbreaks.c (main): Likewise.

3 years agounigbrk: Add unit tests of CR-LF sequences.
Bruno Haible [Wed, 29 Dec 2021 11:13:28 +0000 (12:13 +0100)]
unigbrk: Add unit tests of CR-LF sequences.

* tests/unigbrk/test-u8-grapheme-breaks.c (main): Add test of a string
with CR-LF.
* tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise.
* tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise.

3 years agounilbrk: Update handling of Hebrew letter + hyphen for Unicode 10.0.0.
Bruno Haible [Wed, 29 Dec 2021 08:12:34 +0000 (09:12 +0100)]
unilbrk: Update handling of Hebrew letter + hyphen for Unicode 10.0.0.

* lib/unilbrk/lbrktables.h (LBP_HL_BA): New enum value.
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Add
code for handling break-after character after Hebrew letter.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks):
Likewise.
* tests/unilbrk/test-u8-possible-linebreaks.c (main): Add a test
regarding break-after character after Hebrew letter.
* tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.

3 years agonstrftime: improve handling of invalid formats
Paul Eggert [Tue, 28 Dec 2021 23:28:08 +0000 (15:28 -0800)]
nstrftime: improve handling of invalid formats

* lib/nstrftime.c (__strftime_internal): Without this change,
‘date +'%0_-+^#1%A'’ would output ‘%A’; with it, it outputs
something like ‘%0_-+^#1Tuesday’ which is easier to debug and to
write wrappers for (such as the nstrftime/fprintftime usage in GNU
‘date’).

3 years ago* lib/gettime-res.c: 1 cs -> 10 ms in comment.
Paul Eggert [Tue, 28 Dec 2021 23:12:19 +0000 (15:12 -0800)]
* lib/gettime-res.c: 1 cs -> 10 ms in comment.

3 years ago* lib/gettime-res.c (gcd): Mark with _GL_ATTRIBUTE_CONST.
Paul Eggert [Tue, 28 Dec 2021 23:10:52 +0000 (15:10 -0800)]
* lib/gettime-res.c (gcd): Mark with _GL_ATTRIBUTE_CONST.

3 years agounilbrk: Update handling of regional indicators for Unicode 10.0.0.
Bruno Haible [Tue, 28 Dec 2021 23:06:17 +0000 (00:06 +0100)]
unilbrk: Update handling of regional indicators for Unicode 10.0.0.

* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Add
code for handling regional indicators.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks):
Likewise.
* tests/unilbrk/test-u8-possible-linebreaks.c (main): Add a test
regarding regional indicators.
* tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.

3 years agounilbrk: Update handling of zero-width joiner for Unicode 10.0.0.
Bruno Haible [Tue, 28 Dec 2021 23:06:11 +0000 (00:06 +0100)]
unilbrk: Update handling of zero-width joiner for Unicode 10.0.0.

* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Update
code for zero-width joiner handling to match UAX #14 for Unicode 10.0.0.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks):
Likewise.
* tests/unilbrk/test-u8-possible-linebreaks.c (main): Add a test
regarding zero-width joiner.
* tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.

3 years agounilbrk: Update handling of combining marks for Unicode 10.0.0.
Bruno Haible [Tue, 28 Dec 2021 23:06:05 +0000 (00:06 +0100)]
unilbrk: Update handling of combining marks for Unicode 10.0.0.

* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks): Update
code for combining characters to match UAX #14 for Unicode 10.0.0.
Remove legacy support for space + combining mark.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks):
Likewise.
* tests/unilbrk/test-u8-possible-linebreaks.c (main): Add a test
regarding combining characters.
* tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.

3 years agounilbrk: Restore deviation for (IS,AL) pair.
Bruno Haible [Tue, 28 Dec 2021 23:06:00 +0000 (00:06 +0100)]
unilbrk: Restore deviation for (IS,AL) pair.

* lib/gen-uni-tables.c (output_lbrk_rules_as_tables): Disable rule LB29.
* lib/unilbrk/lbrktables.c: Regenerated.
* tests/unilbrk/test-u8-possible-linebreaks.c (main): Add test case with
HTML markup.
* tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-ulc-possible-linebreaks.c (main): Likewise.

3 years agounilbrk: Change algorithm to be closer to Unicode Standard Annex #14.
Bruno Haible [Tue, 28 Dec 2021 23:05:52 +0000 (00:05 +0100)]
unilbrk: Change algorithm to be closer to Unicode Standard Annex #14.

* lib/gen-uni-tables.c (lbp_value_to_string): New function, extracted
from output_lbp.
(output_lbp): Invoke it.
(output_lbrk_rules_as_tables): New function.
(main): Invoke it.
* lib/unilbrk/lbrktables.c: Now automatically generated.
* tests/unilbrk/test-u8-possible-linebreaks.c (main): Update expected
result.
* tests/unilbrk/test-u16-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-u32-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-ulc-possible-linebreaks.c (main): Likewise.
* tests/unilbrk/test-ulc-width-linebreaks.c (main): Likewise.

3 years agouniwbrk: Add unit tests of regional indicators.
Bruno Haible [Tue, 28 Dec 2021 23:05:45 +0000 (00:05 +0100)]
uniwbrk: Add unit tests of regional indicators.

* tests/uniwbrk/test-u8-wordbreaks.c (main): Add test of regional
indicators.
* tests/uniwbrk/test-u16-wordbreaks.c (main): Likewise.
* tests/uniwbrk/test-u32-wordbreaks.c (main): Likewise.

3 years agounigbrk: Simplify code for regional indicators.
Bruno Haible [Tue, 28 Dec 2021 23:04:33 +0000 (00:04 +0100)]
unigbrk: Simplify code for regional indicators.

* lib/unigbrk/u-grapheme-breaks.h (FUNC): Make code for regional
indicators more future-proof.
* tests/unigbrk/test-u8-grapheme-breaks.c (main): Add test of regional
indicators.
* tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise.
* tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise.

3 years agoclock_getres: document portability issues better
Paul Eggert [Tue, 28 Dec 2021 20:03:37 +0000 (12:03 -0800)]
clock_getres: document portability issues better

* doc/posix-functions/clock_getres.texi:
* doc/posix-functions/timespec_getres.texi:
Document problems with timestamp resolution.

3 years agotimespec_getres: new module
Paul Eggert [Tue, 28 Dec 2021 19:39:17 +0000 (11:39 -0800)]
timespec_getres: new module

* lib/time.in.h (timespec_getres): New decl.
* lib/timespec_getres.c, m4/timespec_getres.m4:
* modules/timespec_getres, modules/timespec_getres-tests:
* tests/test-timespec_getres.c:
New files.
* m4/time_h.m4 (gl_TIME_H_REQUIRE_DEFAULTS, gl_TIME_H_DEFAULTS):
* modules/time (time.h):
Support timespec_getres.

3 years agogettime-res: new module
Paul Eggert [Tue, 28 Dec 2021 19:38:33 +0000 (11:38 -0800)]
gettime-res: new module

* lib/gettime-res.c, modules/gettime-res: New files.
* lib/timespec.h (gettime_res): New decl.
* m4/clock_time.m4 (gl_CLOCK_TIME): Also check for clock_getres.
* m4/gettime.m4 (gl_GETTIME_RES): New macro.

3 years agoclock_gettime: improve doc
Paul Eggert [Tue, 28 Dec 2021 19:38:32 +0000 (11:38 -0800)]
clock_gettime: improve doc

3 years agogettime: port better to non-POSIX C2x
Paul Eggert [Tue, 28 Dec 2021 19:38:26 +0000 (11:38 -0800)]
gettime: port better to non-POSIX C2x

C2x requires a function timespec_get; prefer that to
gettimeofday, since it has better resolution.
* lib/gettime.c (gettime): Prefer timespec_get to gettimeofday.
* m4/gettime.m4 (gl_GETTIME): Check for timespec_get.
Omit a check for gettimeofday; not needed because
the gettime module depends on the gettimeofday module.

3 years agogen-uni-tables: Produce license notices suitable for Gnulib.
Bruno Haible [Tue, 28 Dec 2021 11:55:48 +0000 (12:55 +0100)]
gen-uni-tables: Produce license notices suitable for Gnulib.

* lib/gen-uni-tables.c (output_library_license, output_tests_license):
Produce license notices that are consistent with the
gnulib/etc/license-notices/ files.
* All generated files under lib/uni* and tests/uni*: Regenerate.

3 years agounigbrk, uniwbrk: No-op tweaks.
Bruno Haible [Mon, 27 Dec 2021 12:01:50 +0000 (13:01 +0100)]
unigbrk, uniwbrk: No-op tweaks.

* lib/unigbrk/u-grapheme-breaks.h: Comment tweaks.
* lib/uniwbrk/u-wordbreaks.h: Coding style and comment tweaks.
* lib/uniwbrk/wbrktable.c: Comment tweaks.

3 years agoperl: let caller see whether perl was found
Paul Eggert [Tue, 28 Dec 2021 09:51:56 +0000 (01:51 -0800)]
perl: let caller see whether perl was found

Problem reported for coreutils by Serge Belyshev (Bug#52844).
* m4/perl.m4 (gl_PERL): Use AC_CACHE_CHECK, so that
an invoker of gl_PERL can later inspect gl_cv_prog_perl
to see whether perl was found.

3 years agoFix --automake-subdir breakage (regression 2021-12-24).
Bruno Haible [Tue, 28 Dec 2021 09:03:53 +0000 (10:03 +0100)]
Fix --automake-subdir breakage (regression 2021-12-24).

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

* build-aux/prefix-gnulib-mk (prefix_assignment): Don't change
SED_HEADER_* variables.

3 years agoUpdate to Unicode 10.0.0, part 3.
Bruno Haible [Sun, 26 Dec 2021 18:54:42 +0000 (19:54 +0100)]
Update to Unicode 10.0.0, part 3.

* lib/gen-uni-tables.c (get_lbp): Update such that unilbrk/lbrkprop.txt comes
out as expected. Use is_property_regional_indicator.
(get_wbp): Update such that uniwbrk/wbrkprop.txt comes out as expected.
Use is_property_regional_indicator.

* lib/uniname/gen-uninames.lisp (main): Ignore empty lines and comment
lines in the aliases file. Needed because since 2015-06-20, we use the
unmodified Unicode NameAliases.txt file. Remove reference to undefined
variable. Correct indentation.

* tests/uniwidth/test-uc_width2.sh: Expect width 0 for the characters
0x0AFA..0x0AFF, 0x0D00, 0x0D3B..0x0D3C, 0x1DF6..0x1DF9,
0x11A01..0x11A06, 0x11A09..0x11A0A, 0x11A33..0x11A38, 0x11A3B..0x11A3E,
0x11A47, 0x11A51..0x11A56, 0x11A59..0x11A5B, 0x11A8A..0x11A96,
0x11A98..0x11A99, 0x11D31..0x11D36, 0x11D3A, 0x11D3C..0x11D3D,
0x11D3F..0x11D45, 0x11D47.

3 years agoautoupdate
Karl Berry [Sun, 26 Dec 2021 22:05:18 +0000 (14:05 -0800)]
autoupdate

3 years agoUpdate to Unicode 10.0.0, part 2.
Bruno Haible [Sun, 26 Dec 2021 18:30:41 +0000 (19:30 +0100)]
Update to Unicode 10.0.0, part 2.

* lib/unictype.in.h (UC_PROPERTY_REGIONAL_INDICATOR,
uc_is_property_regional_indicator): New declarations.

3 years agoUpdate to Unicode 10.0.0.
Bruno Haible [Sun, 26 Dec 2021 16:48:24 +0000 (17:48 +0100)]
Update to Unicode 10.0.0.

* lib/gen-uni-tables.c (PROP_REGIONAL_INDICATOR): New enum value.
(fill_properties): Recognize property "Regional_Indicator".
(is_property_regional_indicator): New function.
(output_properties): Also output the data for regional_indicator.
(UC_JOINING_GROUP_MALAYALAM_*): New enum values.
(fill_arabicshaping, joining_group_as_c_identifier): Recognize these
joining groups.

* lib/unictype/pr_regional_indicator.c: New file.
* modules/unictype/property-regional-indicator: New file.
* modules/unictype/property-regional-indicator-tests: New file.
* modules/unictype/property-all (Depends-on): Add
unictype/property-regional-indicator.

* lib/unictype.in.h (UC_JOINING_GROUP_MALAYALAM_*): New enum values.
* lib/unictype/joininggroup_name.h: Add the MALAYALAM_* joining groups.
* lib/unictype/joininggroup_byname.gperf: Likewise.

* lib/uniwidth/width.c (nonspacing_table_data, nonspacing_table_ind):
Update.
* tests/uniwidth/test-uc_width2.sh: Update.

* All generated files under lib/uni* and tests/uni*: Regenerate.
* tests/uniname/NameAliases.txt: Update.
* tests/uniname/UnicodeData.txt: Update.
* tests/uninorm/NormalizationTest.txt: Update.
* tests/unigbrk/GraphemeBreakTest.txt: Update.
* tests/uniwbrk/WordBreakTest.txt: Update.

* All the affected modules: Bump required libunistring version.

3 years agopselect: Fix compilation error in C++ mode on AIX 7.
Bruno Haible [Sun, 26 Dec 2021 11:46:40 +0000 (12:46 +0100)]
pselect: Fix compilation error in C++ mode on AIX 7.

* lib/sys_select.in.h (pselect): Use _GL_CXXALIAS_SYS_CAST instead of
_GL_CXXALIAS_SYS.
* doc/posix-functions/pselect.texi: Mention the AIX problem.

3 years agoautoupdate
Karl Berry [Sat, 25 Dec 2021 17:09:38 +0000 (09:09 -0800)]
autoupdate

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reported by Paul Eggert.

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

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

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

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

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

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