]> Savannah Git Hosting - gnulib.git/log
gnulib.git
7 months agofflush: NetBSD, OpenBSD can’t fflush input
Paul Eggert [Mon, 16 Sep 2024 22:32:17 +0000 (15:32 -0700)]
fflush: NetBSD, OpenBSD can’t fflush input

* m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): Guess no on NetBSD and
OpenBSD; they document fflush to fail unless the stream is open
for writing.

7 months agounictype/category-of: Fix integer overflow in generated table.
Bruno Haible [Mon, 16 Sep 2024 21:37:44 +0000 (23:37 +0200)]
unictype/category-of: Fix integer overflow in generated table.

Reported by clang through -Wconstant-conversion warnings.

* lib/gen-uni-tables.c (output_category): Generate a level2 array of
'unsigned short', not 'short', values.
* lib/unictype/categ_of.h: Regenerated.
* lib/unictype/categ_of.c (lookup_withtable): Update accordingly.

7 months agounilbrk tests: Avoid two gcc -Wparentheses warnings.
Bruno Haible [Mon, 16 Sep 2024 20:40:40 +0000 (22:40 +0200)]
unilbrk tests: Avoid two gcc -Wparentheses warnings.

* tests/unilbrk/test-uc-possible-linebreaks.c (main): Add redundant
parentheses.

7 months agoFix typo in previous patch
Paul Eggert [Mon, 16 Sep 2024 18:19:17 +0000 (11:19 -0700)]
Fix typo in previous patch

7 months agoparse-datetime no longer depends on nstrftime
Paul Eggert [Mon, 16 Sep 2024 18:12:24 +0000 (11:12 -0700)]
parse-datetime no longer depends on nstrftime

I discovered this unnecessary dependency when debugging
GNU Patch.
* lib/parse-datetime.y:
(populate_local_time_zone_table) [!HAVE_STRUCT_TM_TM_ZONE]:
(debug_strfdatetime): Use strftime not nstrftime,
as we don’t need nstrftime’s extensions or bug fixes.
* modules/parse-datetime (Depends-on): Remove nstrftime.
Also remove setenv, unsetenv, timegm, as this module
no longer depends on them directly.

7 months agoDocument use of empty macro args.
Paul Eggert [Mon, 16 Sep 2024 16:54:08 +0000 (09:54 -0700)]
Document use of empty macro args.

7 months agoDon’t port July [[...]] changes to C89
Paul Eggert [Mon, 16 Sep 2024 16:45:36 +0000 (09:45 -0700)]
Don’t port July [[...]] changes to C89

Yesterday’s changes to port to C17 and earlier were intrusive,
since they twice replaced one macro with two.  Revert the macro
definitions to what they were before yesterday, and instead change
callers so that they always have four arguments even if the last
one is empty.  Although this change requires C99 or later, that’s
safe nowadays.  Suggested by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-09/msg00079.html
* lib/c++defs.h (_GL_FUNCDECL_RPL, _GL_FUNCDECL_SYS):
Revert yesterday’s changes.  All callers changed.
Add comments explaining the required comma before missing attrs.

7 months agowchar: Fix compilation error (regression yesterday).
Bruno Haible [Mon, 16 Sep 2024 11:24:48 +0000 (13:24 +0200)]
wchar: Fix compilation error (regression yesterday).

* lib/wchar.in.h (wctob): Use _GL_FUNCATTR_RPL, _GL_FUNCATTR_SYS here
as well.

7 months agowchar: Fix compilation error (regression yesterday).
Bruno Haible [Mon, 16 Sep 2024 09:22:36 +0000 (11:22 +0200)]
wchar: Fix compilation error (regression yesterday).

* lib/wchar.in.h (btowc): Use _GL_FUNCATTR_RPL, _GL_FUNCATTR_SYS here
as well.

7 months agoPort July changes for [[...]] to C17
Paul Eggert [Mon, 16 Sep 2024 04:20:15 +0000 (21:20 -0700)]
Port July changes for [[...]] to C17

The July 30 changes to _GL_FUNCDECL_RPL etc. to support use of
attributes in bracket syntax used a C23 preprocessor feature that is
a common extension to C17 and earlier, but which doesn’t work when
compiled with stricter C17-and-earlier compilers.  The feature is
using ‘#define f(a, ...) b’ and calling ‘f’ with only one arg.
Port back to C17 and earlier.  Problem discovered with
IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72) on cfarm111.
* lib/c++defs.h (_GL_FUNCDECL_RPL): Turn this into two macros
_GL_FUNCDECL_RPL and _GL_FUNCATTR_RPL.  The first macro is for
functions without attributes, the second one for functions with
attributes.  All uses changed.
(_GL_FUNCDECL_SYS): Likewise, turn this into _GL_FUNCDECL_SYS
and _GL_FUNCATTR_SYS.

7 months agounilbrk: Some more tweaks.
Bruno Haible [Sun, 15 Sep 2024 23:05:00 +0000 (01:05 +0200)]
unilbrk: Some more tweaks.

* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Assign to preceding_prop at each loop round. Assign to prev2_ea,
prev_ea, prev_nus also when a line break was seen.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.

7 months agounilbrk: Strengthen tests.
Bruno Haible [Sun, 15 Sep 2024 13:27:34 +0000 (15:27 +0200)]
unilbrk: Strengthen tests.

* lib/gen-uni-tables.c: Add shell commands for creating
tests/unilbrk/LineBreakTest.txt.
* tests/unilbrk/LineBreakTest.txt: New file, from unicode.org.
* tests/unilbrk/test-uc-possible-linebreaks.c: New file, based on
tests/uniwbrk/test-uc-wordbreaks.c.
* tests/unilbrk/test-uc-possible-linebreaks.sh: New file, based on
tests/uniwbrk/test-uc-wordbreaks.sh.
* modules/unilbrk/u32-possible-linebreaks-tests (Files): Add them.
(Makefile.am): Arrange to compile test-uc-possible-linebreaks.c and test
test-uc-possible-linebreaks.sh.

7 months agouniwbrk tests: Modernize code.
Bruno Haible [Sun, 15 Sep 2024 13:20:08 +0000 (15:20 +0200)]
uniwbrk tests: Modernize code.

* tests/uniwbrk/test-uc-wordbreaks.c (main): Reduce the scope of local
variables. Remove memset() calls. Align expected and actial output
lines. Add comments.

7 months agounigbrk tests: Modernize code.
Bruno Haible [Sun, 15 Sep 2024 13:16:52 +0000 (15:16 +0200)]
unigbrk tests: Modernize code.

* tests/unigbrk/test-uc-grapheme-breaks.c (main): Reduce the scope of
local variables. Add comments.
* tests/unigbrk/test-uc-is-grapheme-break.c (main): Likewise.

7 months agounilbrk: Fix conflicts between rules.
Bruno Haible [Sun, 15 Sep 2024 13:06:01 +0000 (15:06 +0200)]
unilbrk: Fix conflicts between rules.

* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Avoid side effect of (LB18) on (LB14) and (LB15a). Avoid side effect
of (LB19a) on (LB18).
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.

7 months agounilbrk: Enable most cases of Unicode rule (LB29).
Bruno Haible [Sun, 15 Sep 2024 13:00:30 +0000 (15:00 +0200)]
unilbrk: Enable most cases of Unicode rule (LB29).

* lib/gen-uni-tables.c (output_lbrk_rules_as_tables): Enable rule LB29.
* lib/unilbrk/lbrktables.c: Regenerated.
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Allow a break between a character with property IS and '<'.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.

7 months agounilbrk: Fully implement Unicode rule (LB9).
Bruno Haible [Sun, 15 Sep 2024 11:23:04 +0000 (13:23 +0200)]
unilbrk: Fully implement Unicode rule (LB9).

* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
New variable preceding_prop. Don't copy prop to prev_prop and ea to
prev_ea if the conditions of rule (LB9) apply.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.

7 months agounilbrk: Fix bugs in implementation of Unicode rules (LB15a), (LB15b).
Bruno Haible [Sun, 15 Sep 2024 10:59:46 +0000 (12:59 +0200)]
unilbrk: Fix bugs in implementation of Unicode rules (LB15a), (LB15b).

* lib/gen-uni-tables.c (output_lbrk_rules_as_tables): Fix typo in
comment.
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Do the LBP_QU2 to LBP_QU1 mapping for (LB15a) after the table lookup but
before the assignment to last_prop. Do the LBP_QU3 to LBP_QU1 mapping
for (LB15b) in a way that does not influence prev_prop or last_prop.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.

7 months agounilbrk: Fix bug in implementation of Unicode rule (LB16).
Bruno Haible [Sat, 14 Sep 2024 23:29:27 +0000 (01:29 +0200)]
unilbrk: Fix bug in implementation of Unicode rule (LB16).

* lib/gen-uni-tables.c (output_lbrk_rules_as_tables): Fix typo.
* lib/unilbrk/lbrktables.c: Regenerated.

7 months agounilbrk: Fix handling of unassigned code points (regression yesterday).
Bruno Haible [Sat, 14 Sep 2024 19:13:20 +0000 (21:13 +0200)]
unilbrk: Fix handling of unassigned code points (regression yesterday).

* lib/unilbrk/lbrktables.h (unilbrkprop_lookup): Correct the default
return value.

7 months agounilbrk/tables: Fix table (regression yesterday).
Bruno Haible [Sat, 14 Sep 2024 09:56:38 +0000 (11:56 +0200)]
unilbrk/tables: Fix table (regression yesterday).

Reported by Collin Funk <collin.funk1@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00061.html>.

* lib/gen-uni-tables.c (output_lbrk_rules_as_tables): Use LBP_AL1 as
array index instead of LBP_AL. Update comments.
* lib/unilbrk/lbrktables.c: Regenerated.

7 months agoImplement a new property, added by Unicode 16.0.0.
Bruno Haible [Fri, 13 Sep 2024 13:25:05 +0000 (15:25 +0200)]
Implement a new property, added by Unicode 16.0.0.

* lib/gen-uni-tables.c (is_property_modifier_combining_mark): New
function.
(output_properties): Output also the property modifier_combining_mark.
* lib/unictype.in.h (UC_PROPERTY_MODIFIER_COMBINING_MARK,
uc_is_property_modifier_combining_mark): New declarations.
* m4/unictype_h.m4 (gl_UNICTYPE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_UNICTYPE_PROPERTY_MODIFIER_COMBINING_MARK.
* modules/unictype/base (Makefile.am): Substitute
GNULIB_UNICTYPE_PROPERTY_MODIFIER_COMBINING_MARK.
* lib/unictype/pr_modifier_combining_mark.c: New file.
* lib/unictype/pr_modifier_combining_mark.h: New generated file.
* modules/unictype/property-modifier-combining-mark: New file.
* tests/unictype/test-pr_modifier_combining_mark.c: New generated file.
* modules/unictype/property-modifier-combining-mark-tests: New file.
* lib/unictype/pr_byname.gperf: Add modifier_combining_mark.
* lib/unictype/pr_byname.c
(UC_PROPERTY_INDEX_MODIFIER_COMBINING_MARK): New enum item.
(uc_property_byname): Handle it.
* modules/unictype/property-byname (Depends-on): Add
unictype/property-modifier-combining-mark.
* modules/unictype/property-all (Depends-on): Likewise.
* MODULES.html.sh (func_all_modules): Add
unictype/property-modifier-combining-mark.

7 months agoUpdate to Unicode 16.0.0.
Bruno Haible [Fri, 13 Sep 2024 13:17:49 +0000 (15:17 +0200)]
Update to Unicode 16.0.0.

* lib/gen-uni-tables.c (PROP_MODIFIER_COMBINING_MARK): New enum item.
(fill_properties): Recognize property Modifier_Combining_Mark.
(UC_JOINING_GROUP_KASHMIRI_YEH): New enum item.
(fill_arabicshaping, joining_group_as_c_identifier): Handle
UC_JOINING_GROUP_KASHMIRI_YEH.
(LBP_*): Split LBP_AL into LBP_AL1 and LBP_AL2.
(LBP_AL): New enum item.
(get_lbea): New function.
(get_lbp): Use it. Update such that unilbrk/lbrkprop.txt comes out as
expected. Map U+25CC to LBP_AL2.
(PROP_EA, PROP, EA): New macros.
(debug_output_lbp): Print either LBP_AL1, LBP_AL2 as LBP_AL.
(lbp_value_to_string): Handle LBP_AL1, LBP_AL2 instead of LBP_AL.
(struct lbpea_table): Renamed from struct lbp_table.
(output_lbpea): Renamed from output_lbp. Store both the line break
property and the line break EastAsian bit in the same table entry.
(output_lbrk_tables): Update.
(output_lbrk_rules_as_tables): Update for LBP_AL change. Implement rules
LB28a, LB25, LB19, LB15d, LB13 as specified by
https://www.unicode.org/reports/tr14/tr14-53.html.
(get_wbp): Update such that uniwbrk/wbrkprop.txt comes out as expected.

* lib/unictype.in.h (UC_JOINING_GROUP_KASHMIRI_YEH): New enum item.
* lib/unictype/joininggroup_byname.gperf: Handle it.
* lib/unictype/joininggroup_name.h: Likewise.

* lib/unilbrk/lbrktables.h: Split LBP_AL into LBP_AL1 and LBP_AL2.
(LBP_AKLS_VI): New enum item, for rule LB28a.
(PROP, EA, PROP_EA): New macros.
(unilbrk_table): Update bounds.
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Use LBP_AL1 instead of LBP_AL. Use 2 characters of lookahead, for rules
LB15c, LB19a, LB25, LB28a. New variables prev_ea, prev2_ea, for rule
LB19a. New variable prev_initial_hyphen, for rule LB20a. New variable
prev_nus, for rule LB25. Implement rules LB15c, LB19a, LB20a, LB21a,
LB25, LB28a,  as specified by
https://www.unicode.org/reports/tr14/tr14-53.html.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.
* modules/unilbrk/base (Depends-on): Add stdbool.

* tests/uninorm/test-u32-normalize-big.h
(struct normalization_test_file): Now 6 parts.
* tests/uninorm/test-u32-normalize-big.c (read_normalization_test_file):
Fill in 6 parts.
(test_specific, free_normalization_test_file): Now handle 6 parts.

* tests/uniwidth/test-uc_width2.sh: Update expected test result.

* 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.

7 months agouninorm/composition: Fix mistake in last commit (regression yesterday).
Bruno Haible [Fri, 13 Sep 2024 07:50:15 +0000 (09:50 +0200)]
uninorm/composition: Fix mistake in last commit (regression yesterday).

* modules/uninorm/composition (Files): Add
lib/uninorm/composition-table-bounds.h.

7 months agouninorm/composition: Make more maintainable.
Bruno Haible [Fri, 13 Sep 2024 00:45:37 +0000 (02:45 +0200)]
uninorm/composition: Make more maintainable.

* lib/gen-uni-tables.c (output_composition_tables): Add a filename2
parameter. Emit definitions of UNINORM_COMPOSE_MAX_ARG1 and
UNINORM_COMPOSE_MAX_ARG2 to this file.
(main): Invoke it with additional file name
uninorm/composition-table-bounds.h.
* uninorm/composition-table-bounds.h: New generated file.
* lib/uninorm/composition.c: Include it.
(uc_composition): Use UNINORM_COMPOSE_MAX_ARG1 and
UNINORM_COMPOSE_MAX_ARG2 instead of hardcoded bounds.

7 months agombrtoc16: Fix undefined behaviour.
Bruno Haible [Tue, 10 Sep 2024 11:56:03 +0000 (13:56 +0200)]
mbrtoc16: Fix undefined behaviour.

* lib/mbrtoc16.c (SET_EXTRA_STATE): Cast to 'unsigned int' before
shifting the bits to the positions 31..16.

7 months agostring-desc: Fix undefined behaviour.
Bruno Haible [Tue, 10 Sep 2024 00:07:57 +0000 (02:07 +0200)]
string-desc: Fix undefined behaviour.

* lib/string-desc-contains.c (string_desc_contains): Handle the case of
an empty haystack before invoking 'memmem'.

7 months agostriconv, striconveh, unicodeio: Drop workaround for glibc 2.1.
Bruno Haible [Mon, 9 Sep 2024 14:05:41 +0000 (16:05 +0200)]
striconv, striconveh, unicodeio: Drop workaround for glibc 2.1.

* lib/striconv.c (mem_cd_iconv, str_iconv): Remove glibc-2.1 and
Solaris 9 bug workarounds.
* lib/striconveh.c (mem_cd_iconveh_internal): Likewise.
* lib/unicodeio.c (unicode_to_mb): Likewise.

7 months agostriconv, striconveh: Drop workaround for glibc 2.1.
Bruno Haible [Mon, 9 Sep 2024 13:46:44 +0000 (15:46 +0200)]
striconv, striconveh: Drop workaround for glibc 2.1.

* lib/striconv.c (str_iconv): Remove glibc-2.1 bug workaround.
* lib/striconveh.c (iconveh_open): Likewise.

7 months agocrc.h: declare each function with _GL_ATTRIBUTE_PURE
Jim Meyering [Mon, 9 Sep 2024 06:54:30 +0000 (23:54 -0700)]
crc.h: declare each function with _GL_ATTRIBUTE_PURE

* lib/crc.h (crc32, crc32_update, crc32_no_xor)
(crc32_update_no_xor): Declare with _GL_ATTRIBUTE_PURE.

7 months agoFix COPYING.EXCEPTION license notices
Paul Eggert [Fri, 6 Sep 2024 01:31:29 +0000 (18:31 -0700)]
Fix COPYING.EXCEPTION license notices

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-08/msg00227.html
* m4/std-gnu11.m4: Fix license notice to use COPYING.EXCEPTION
correctly.
* m4/std-gnu23.m4: Likewise.  Also document the commit ID,
since Autoconf was updated likewise and we’re copying from there.

8 months agoResolve conflicts for functions introduced in Android API level 35.
Bruno Haible [Wed, 4 Sep 2024 17:38:52 +0000 (19:38 +0200)]
Resolve conflicts for functions introduced in Android API level 35.

Reported by Po Lu <luangruo@yahoo.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00024.html>.

* lib/time.in.h (timezone_t, tzalloc, tzfree): Don't require _GNU_SOURCE
to be defined. Define depending on HAVE_TZALLOC, not HAVE_TIMEZONE_T.
(localtime_rz, mktime_z): Likewise. Override if REPLACE_LOCALTIME_RZ or
REPLACE_MKTIME_Z is 1, respectively.
* lib/time_rz.c: If NEED_TIMEZONE_NULL_SUPPORT, define only localtime_rz
and mktime_z and only as wrappers around the system function.
* m4/time_h.m4 (gl_TIME_H_DEFAULTS): Initialize HAVE_TZALLOC,
REPLACE_LOCALTIME_RZ, REPLACE_MKTIME_Z.
* m4/time_rz.m4 (gl_TIME_RZ): Conditionally set HAVE_TZALLOC,
REPLACE_LOCALTIME_RZ, REPLACE_MKTIME_Z. Conditionally define
NEED_TIMEZONE_NULL_SUPPORT.
* modules/time-h (Makefile.am): Substitute HAVE_TZALLOC,
REPLACE_LOCALTIME_RZ, REPLACE_MKTIME_Z.
* modules/time_rz (Depends-on, configure.ac): Consider HAVE_TZALLOC,
REPLACE_LOCALTIME_RZ, REPLACE_MKTIME_Z. Ignore HAVE_TIMEZONE_T.

8 months agoResolve conflicts for functions introduced in Android API level 35.
Bruno Haible [Wed, 4 Sep 2024 08:34:04 +0000 (10:34 +0200)]
Resolve conflicts for functions introduced in Android API level 35.

* m4/strerrorname_np.m4 (gl_FUNC_COPY_FILE_RANGE): Conditionally set
REPLACE_STRERRORNAME_NP.
(gl_CHECK_STRERRORNAME_NP): Test for strerrorname_np using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS.

8 months agoDoc regarding functions introduced in Android API level 35.
Bruno Haible [Wed, 4 Sep 2024 08:21:31 +0000 (10:21 +0200)]
Doc regarding functions introduced in Android API level 35.

* doc/posix-functions/_Fork.texi: Mention the Android API levels.
* doc/glibc-functions/epoll_pwait2.texi: Likewise.
* doc/glibc-functions/strerrorname_np.texi: Likewise.

8 months agotests: Strenghten tests with invalid file descriptor.
Bruno Haible [Tue, 3 Sep 2024 21:00:28 +0000 (23:00 +0200)]
tests: Strenghten tests with invalid file descriptor.

* tests/test-close.c: Include <fcntl.h>.
(main): Check that AT_FDCWD is recognized as an invalid file descriptor.
* tests/test-dup.c: Include <fcntl.h>.
(main): Check that AT_FDCWD is recognized as an invalid file descriptor.
* tests/test-unlockpt.c: Include <fcntl.h>.
(main): Check that AT_FDCWD is recognized as an invalid file descriptor.
* tests/test-fchdir.c (main): Likewise.
* tests/test-fdatasync.c (main): Likewise.
* tests/test-fdopendir.c (main): Likewise.
* tests/test-fsync.c (main): Likewise.
* tests/test-isatty.c (main): Likewise.

8 months agodoc: More details about pthread_setname_np.
Bruno Haible [Tue, 3 Sep 2024 20:25:29 +0000 (22:25 +0200)]
doc: More details about pthread_setname_np.

Reported by Eric Gallager <egall@gwmail.gwu.edu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00017.html>.

* doc/glibc-functions/pthread_setname_np.texi: Mention the different
signature on macOS.

8 months agosyntax-check: Catch all FSF postal addresses.
Simon Josefsson [Tue, 3 Sep 2024 18:40:51 +0000 (20:40 +0200)]
syntax-check: Catch all FSF postal addresses.

* top/maint.mk (sc_franklin_street): Rename to sc_fsf_postal,
improve regexp.

8 months agounlockpt tests: Avoid test failure on Haiku.
Bruno Haible [Tue, 3 Sep 2024 11:32:40 +0000 (13:32 +0200)]
unlockpt tests: Avoid test failure on Haiku.

* tests/test-unlockpt.c (main): Skip the test on Haiku.
* doc/posix-functions/unlockpt.texi: Update platforms list.

8 months agodoc: Mention a gmtime_r problem.
Bruno Haible [Tue, 3 Sep 2024 09:34:11 +0000 (11:34 +0200)]
doc: Mention a gmtime_r problem.

* doc/posix-functions/gmtime_r.texi: Mention "UTC" vs. "GMT".

8 months agovma-prot tests: Strengthen test.
Bruno Haible [Mon, 2 Sep 2024 11:49:05 +0000 (13:49 +0200)]
vma-prot tests: Strengthen test.

Found by Coverity.

* tests/test-vma-prot.c (main): Fix typo.

8 months agosyntax-check: Catch obsolete Franklin Street usages.
Simon Josefsson [Mon, 2 Sep 2024 10:46:38 +0000 (12:46 +0200)]
syntax-check: Catch obsolete Franklin Street usages.

* top/maint.mk (sc_franklin_street): New function.

8 months agoerror, getprogname: Stricter dependency conditions.
Bruno Haible [Mon, 2 Sep 2024 08:42:53 +0000 (10:42 +0200)]
error, getprogname: Stricter dependency conditions.

* modules/error (Depends-on): Add dependency condition.
* modules/getprogname (Depends-on): Make dependency condition stricter.
(configure.ac): Require AC_CANONICAL_HOST.

8 months agoutime, futimens tests: Avoid test failure on Haiku.
Bruno Haible [Mon, 2 Sep 2024 07:27:04 +0000 (09:27 +0200)]
utime, futimens tests: Avoid test failure on Haiku.

* tests/test-utimens-common.h (checkable_atime): On Haiku, return false.

8 months agostrtold: Work around a Haiku bug.
Bruno Haible [Sun, 1 Sep 2024 21:25:42 +0000 (23:25 +0200)]
strtold: Work around a Haiku bug.

* lib/strtod.c (HAVE_UNDERLYING_STRTOD): Set to 0 for 'long double'
parsing on Haiku.
* doc/posix-functions/strtold.texi: Mention the bug.

8 months agomath: Remove workaround for an older Haiku bug.
Bruno Haible [Sun, 1 Sep 2024 16:09:28 +0000 (18:09 +0200)]
math: Remove workaround for an older Haiku bug.

* lib/math.in.h (FP_ILOGB0, FP_ILOGBNAN): Don't override on Haiku.
* doc/posix-headers/math.texi: Update.

8 months agoAvoid using postal address in license
Simon Josefsson [Sun, 1 Sep 2024 13:05:24 +0000 (15:05 +0200)]
Avoid using postal address in license

* lib/dfa.h, lib/dfa.c: Update license header.
* lib/localeinfo.h, lib/localeinfo.c: Likewise.
* tests/test-dfa-match-aux.c: Likewise.

8 months agoFix mbscasestr test failure on native Windows with MSVC.
Bruno Haible [Sun, 1 Sep 2024 11:09:59 +0000 (13:09 +0200)]
Fix mbscasestr test failure on native Windows with MSVC.

* lib/c32to-impl.h (FUNC): On native Windows, ignore the system's
towlower/towupper function entirely.
* tests/test-c32tolower.c (main): On native Windows, reenable test that
previously failed.
* tests/test-c32toupper.c (main): Likewise. Disable two other tests on
native Windows.
* doc/posix-functions/towlower.texi: Mention bug in the native Windows
UTF-8 locale.
* doc/posix-functions/towupper.texi: Likewise.

8 months agoFix quoting of $LOCALE_EN_UTF8 (regression yesterday).
Bruno Haible [Sun, 1 Sep 2024 10:42:30 +0000 (12:42 +0200)]
Fix quoting of $LOCALE_EN_UTF8 (regression yesterday).

* m4/iswdigit.m4 (gl_FUNC_ISWDIGIT): Properly quote $LOCALE_EN_UTF8.
* m4/iswxdigit.m4 (gl_FUNC_ISWXDIGIT): Likewise.
* m4/mbrlen.m4 (gl_MBRLEN_RETVAL): Likewise.
* m4/mbrtoc16.m4 (gl_MBRTOC16_NULL_DESTINATION): Likewise.
* m4/mbrtowc.m4 (gl_MBRTOWC_INCOMPLETE_STATE, gl_MBRTOWC_NULL_ARG1,
gl_MBRTOWC_NULL_ARG2, gl_MBRTOWC_RETVAL, gl_MBRTOWC_STORES_INCOMPLETE):
Likewise.
* m4/mbsrtowcs.m4 (gl_MBSRTOWCS_WORKS): Likewise.
* m4/stdlib_h.m4 (gl_STDLIB_H): Likewise.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise.

8 months agodoc: Mention how to obtain UTF-8 locales.
Bruno Haible [Sun, 1 Sep 2024 09:21:43 +0000 (11:21 +0200)]
doc: Mention how to obtain UTF-8 locales.

* doc/posix-functions/setlocale.texi: Mention the names of UTF-8 locales
and the needed compiler flags.

8 months agodoc: Fix typo.
Collin Funk [Sun, 1 Sep 2024 05:36:31 +0000 (22:36 -0700)]
doc: Fix typo.

* doc/pastposix-functions/siginterrupt.texi (siginterrupt): Fix typo.

8 months agoStrengthen LC_CTYPE configure tests on OpenBSD, Android, Haiku.
Bruno Haible [Sat, 31 Aug 2024 23:57:29 +0000 (01:57 +0200)]
Strengthen LC_CTYPE configure tests on OpenBSD, Android, Haiku.

* m4/mbrlen.m4 (gl_MBRLEN_RETVAL): Require gt_LOCALE_EN_UTF8 instead of
gt_LOCALE_FR_UTF8. Use LOCALE_EN_UTF8 instead of LOCALE_FR_UTF8.
* m4/mbrtowc.m4 (gl_MBRTOWC_INCOMPLETE_STATE, gl_MBRTOWC_SANITYCHECK,
gl_MBRTOWC_NULL_ARG1, gl_MBRTOWC_NULL_ARG2, gl_MBRTOWC_RETVAL,
gl_MBRTOWC_STORES_INCOMPLETE): Likewise.
* m4/mbsrtowcs.m4 (gl_MBSRTOWCS_WORKS): Likewise.
* m4/wcrtomb.m4 (gl_FUNC_WCRTOMB): Likewise.
* m4/mbrtoc16.m4 (gl_MBRTOC16_NULL_DESTINATION): Require
gt_LOCALE_EN_UTF8 instead of gt_LOCALE_FR_UTF8. Use LOCALE_EN_UTF8
instead of LOCALE_FR_UTF8. Update cross-compilation guess.
* m4/stdlib_h.m4 (gl_STDLIB_H): Likewise.
* modules/btowc (Files): Add m4/locale-en.m4.
* modules/c32isalnum (Files): Likewise.
* modules/c32isalpha (Files): Likewise.
* modules/c32isblank (Files): Likewise.
* modules/c32iscntrl (Files): Likewise.
* modules/c32isdigit (Files): Likewise.
* modules/c32isgraph (Files): Likewise.
* modules/c32islower (Files): Likewise.
* modules/c32isprint (Files): Likewise.
* modules/c32ispunct (Files): Likewise.
* modules/c32isspace (Files): Likewise.
* modules/c32isupper (Files): Likewise.
* modules/c32isxdigit (Files): Likewise.
* modules/c32rtomb (Files): Likewise.
* modules/c32tob (Files): Likewise.
* modules/c32tolower (Files): Likewise.
* modules/c32toupper (Files): Likewise.
* modules/c32width (Files): Likewise.
* modules/iswdigit (Files): Likewise.
* modules/mbrtoc16 (Files): Likewise.
* modules/mbrtoc32 (Files): Likewise.
* modules/mbsnrtowcs (Files): Likewise.
* modules/mbsrtowcs (Files): Likewise.
* modules/wcrtomb (Files): Likewise.
* modules/wcsnrtombs (Files): Likewise.
* modules/wcsrtombs (Files): Likewise.
* modules/wctob (Files): Likewise.
* modules/mbrlen (Files): Add m4/locale-en.m4. Remove m4/locale-fr.m4.
* modules/mbrtowc (Files): Likewise.
* modules/stdlib (Files): Likewise.

8 months agoUpdate users.txt.
Colin Watson [Sat, 31 Aug 2024 21:34:30 +0000 (22:34 +0100)]
Update users.txt.

* users.txt: Add libpipeline.

Copyright-paperwork-exempt: Yes

8 months agotests: Avoid some test failures on Android.
Bruno Haible [Sat, 31 Aug 2024 22:13:49 +0000 (00:13 +0200)]
tests: Avoid some test failures on Android.

* tests/test-c32isalpha.c (main): Disable tests that fail on Android.
* tests/test-c32iscntrl.c (main): Likewise.
* tests/test-c32isgraph.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.

8 months agotests: Avoid some test failures on OpenBSD 7.5.
Bruno Haible [Sat, 31 Aug 2024 22:13:39 +0000 (00:13 +0200)]
tests: Avoid some test failures on OpenBSD 7.5.

* tests/test-c32isalpha.c (main): Disable tests that fail on
OpenBSD 7.5.
* tests/test-c32iscntrl.c (main): Likewise.
* tests/test-c32isgraph.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.

8 months agoiswxdigit: Work around OpenBSD, Android, Haiku bug.
Bruno Haible [Sat, 31 Aug 2024 22:12:54 +0000 (00:12 +0200)]
iswxdigit: Work around OpenBSD, Android, Haiku bug.

* m4/iswxdigit.m4 (gl_FUNC_ISWXDIGIT): Require gt_LOCALE_EN_UTF8 instead
of gt_LOCALE_FR_UTF8. Use LOCALE_EN_UTF8 instead of LOCALE_FR_UTF8.
Update cross-compilation guess.
* modules/iswxdigit (Files): Add m4/locale-en.m4. Remove m4/locale-fr.m4.
* doc/posix-functions/iswxdigit.texi: Update list of platforms.

8 months agoiswdigit: Work around OpenBSD, Android, Haiku bug.
Bruno Haible [Sat, 31 Aug 2024 22:11:12 +0000 (00:11 +0200)]
iswdigit: Work around OpenBSD, Android, Haiku bug.

* m4/iswdigit.m4 (gl_FUNC_ISWDIGIT): Require gt_LOCALE_EN_UTF8 instead
of gt_LOCALE_FR_UTF8. Use LOCALE_EN_UTF8 instead of LOCALE_FR_UTF8.
Update cross-compilation guess.
* modules/iswdigit (Files): Add m4/locale-en.m4.
* doc/posix-functions/iswdigit.texi: Update list of platforms.

8 months agotests: Strengthen LC_CTYPE tests on OpenBSD, Android, Haiku.
Bruno Haible [Sat, 31 Aug 2024 17:22:37 +0000 (19:22 +0200)]
tests: Strengthen LC_CTYPE tests on OpenBSD, Android, Haiku.

* m4/locale-en.m4: New file, based on m4/locale-fr.m4.
* m4/locale-ar.m4 (gt_LOCALE_AR): Update comments.
* m4/locale-fr.m4 (gt_LOCALE_FR, gt_LOCALE_FR_UTF8): Likewise.
* m4/locale-ja.m4 (gt_LOCALE_JA): Likewise.
* m4/locale-tr.m4 (gt_LOCALE_TR_UTF8): Likewise.
* m4/locale-zh.m4 (gt_LOCALE_ZH_CN): Likewise.
* modules/btoc32-tests (Files): Add m4/locale-en.m4.
(configure.ac): Invoke gt_LOCALE_EN_UTF8.
(Makefile.am): Set LOCALE_EN_UTF8 in TESTS_ENVIRONMENT.
* modules/btowc-tests: Likewise.
* modules/c32isalnum-tests: Likewise.
* modules/c32isalpha-tests: Likewise.
* modules/c32isblank-tests: Likewise.
* modules/c32iscntrl-tests: Likewise.
* modules/c32isdigit-tests: Likewise.
* modules/c32isgraph-tests: Likewise.
* modules/c32islower-tests: Likewise.
* modules/c32isprint-tests: Likewise.
* modules/c32ispunct-tests: Likewise.
* modules/c32isspace-tests: Likewise.
* modules/c32isupper-tests: Likewise.
* modules/c32isxdigit-tests: Likewise.
* modules/c32rtomb-tests: Likewise.
* modules/c32snrtombs-tests: Likewise.
* modules/c32srtombs-tests: Likewise.
* modules/c32stombs-tests: Likewise.
* modules/c32tolower-tests: Likewise.
* modules/c32toupper-tests: Likewise.
* modules/fnmatch-tests: Likewise.
* modules/iswdigit-tests: Likewise.
* modules/iswxdigit-tests: Likewise.
* modules/mbmemcasecmp-tests: Likewise.
* modules/mbmemcasecoll-tests: Likewise.
* modules/mbrlen-tests: Likewise.
* modules/mbrtoc16-tests: Likewise.
* modules/mbrtoc32-tests: Likewise.
* modules/mbrtowc-tests: Likewise.
* modules/mbscasestr-tests: Likewise.
* modules/mbscspn-tests: Likewise.
* modules/mbsinit-tests: Likewise.
* modules/mbslen-tests: Likewise.
* modules/mbsnlen-tests: Likewise.
* modules/mbsnrtoc32s-tests: Likewise.
* modules/mbsnrtowcs-tests: Likewise.
* modules/mbspbrk-tests: Likewise.
* modules/mbsrtoc32s-tests: Likewise.
* modules/mbsrtowcs-tests: Likewise.
* modules/mbsspn-tests: Likewise.
* modules/mbsstr-tests: Likewise.
* modules/mbstoc32s-tests: Likewise.
* modules/mbstowcs-tests: Likewise.
* modules/mcel-tests: Likewise.
* modules/trim-tests: Likewise.
* modules/unicodeio-tests: Likewise.
* modules/wcrtomb-tests: Likewise.
* modules/wcsnrtombs-tests: Likewise.
* modules/wcsrtombs-tests: Likewise.
* tests/test-btoc32-3.sh: If LOCALE_FR_UTF8 is 'none', try
LOCALE_EN_UTF8 instead.
* tests/test-btowc-3.sh: Likewise.
* tests/test-c32isalnum.sh: Likewise.
* tests/test-c32isalpha.sh: Likewise.
* tests/test-c32isblank.sh: Likewise.
* tests/test-c32iscntrl.sh: Likewise.
* tests/test-c32isdigit.sh: Likewise.
* tests/test-c32isgraph.sh: Likewise.
* tests/test-c32islower.sh: Likewise.
* tests/test-c32isprint.sh: Likewise.
* tests/test-c32ispunct.sh: Likewise.
* tests/test-c32isspace.sh: Likewise.
* tests/test-c32isupper.sh: Likewise.
* tests/test-c32isxdigit.sh: Likewise.
* tests/test-c32rtomb.sh: Likewise.
* tests/test-c32snrtombs-3.sh: Likewise.
* tests/test-c32srtombs-3.sh: Likewise.
* tests/test-c32stombs-3.sh: Likewise.
* tests/test-c32tolower.sh: Likewise.
* tests/test-c32toupper.sh: Likewise.
* tests/test-fnmatch-3.sh: Likewise.
* tests/test-iswdigit.sh: Likewise.
* tests/test-iswxdigit.sh: Likewise.
* tests/test-mbmemcasecmp-3.sh: Likewise.
* tests/test-mbmemcasecoll-3.sh: Likewise.
* tests/test-mbrlen-3.sh: Likewise.
* tests/test-mbrtoc16-3.sh: Likewise.
* tests/test-mbrtoc32-3.sh: Likewise.
* tests/test-mbrtowc-3.sh: Likewise.
* tests/test-mbscasestr2.sh: Likewise.
* tests/test-mbscspn.sh: Likewise.
* tests/test-mbsinit.sh: Likewise.
* tests/test-mbslen.sh: Likewise.
* tests/test-mbsnlen.sh: Likewise.
* tests/test-mbsnrtoc32s-3.sh: Likewise.
* tests/test-mbsnrtowcs-3.sh: Likewise.
* tests/test-mbspbrk.sh: Likewise.
* tests/test-mbsrtoc32s-3.sh: Likewise.
* tests/test-mbsrtowcs-3.sh: Likewise.
* tests/test-mbsspn.sh: Likewise.
* tests/test-mbsstr2.sh: Likewise.
* tests/test-mbstoc32s-3.sh: Likewise.
* tests/test-mbstowcs-3.sh: Likewise.
* tests/test-mcel-3.sh: Likewise.
* tests/test-trim2.sh: Likewise.
* tests/test-unicodeio2.sh: Likewise.
* tests/test-wcrtomb.sh: Likewise.
* tests/test-wcsnrtombs-3.sh: Likewise.
* tests/test-wcsrtombs-3.sh: Likewise.

8 months agotrim, unicodeio tests: Fix module description.
Bruno Haible [Sat, 31 Aug 2024 16:23:33 +0000 (18:23 +0200)]
trim, unicodeio tests: Fix module description.

* modules/trim-tests (configure.ac): Invoke the respective gt_LOCALE_*
macros.
* modules/unicodeio-tests (Makefile.am): Augment TESTS_ENVIRONMENT.

8 months agombrtoc32: Fix a cross-compilation guess.
Bruno Haible [Sat, 31 Aug 2024 11:57:39 +0000 (13:57 +0200)]
mbrtoc32: Fix a cross-compilation guess.

* m4/mbrtoc32.m4 (gl_MBRTOC32_UTF8_LOCALE): Guess no on Cygwin.

8 months agomkfifoat: Work around a Haiku bug.
Bruno Haible [Fri, 30 Aug 2024 23:28:32 +0000 (01:28 +0200)]
mkfifoat: Work around a Haiku bug.

* lib/mknodat.c (rpl_mknodat): On Haiku, handle S_IFIFO explicitly.
* doc/posix-functions/mknodat.texi: Mention the S_IFIFO flag bug.

8 months agodoc: Mention an mknod bug.
Bruno Haible [Fri, 30 Aug 2024 23:20:50 +0000 (01:20 +0200)]
doc: Mention an mknod bug.

* doc/posix-functions/mknod.texi: Mention the S_IFIFO flag bug.

8 months agoposix_openpt tests: Fix test failure on Haiku.
Bruno Haible [Fri, 30 Aug 2024 21:48:44 +0000 (23:48 +0200)]
posix_openpt tests: Fix test failure on Haiku.

* tests/test-posix_openpt.c (main): On Haiku, create a child process and
call setsid().

8 months agoTrivial relicensing of macro-only modules, part 3.
Bruno Haible [Fri, 30 Aug 2024 16:08:10 +0000 (18:08 +0200)]
Trivial relicensing of macro-only modules, part 3.

* modules/config-h (License): Change to unlimited.
* modules/host-os (License): Likewise.
* modules/no-c++ (License): Likewise.
* modules/openmp (License): Likewise.
* modules/longlong (License): Change to LGPLv2+.
* modules/va-args (License): Likewise.

8 months agoTrivial relicensing of macro-only modules, part 2.
Bruno Haible [Fri, 30 Aug 2024 16:02:52 +0000 (18:02 +0200)]
Trivial relicensing of macro-only modules, part 2.

* modules/bison (License): Change to unlimited.
* modules/perl (License): Likewise.

8 months agoTrivial relicensing of macro-only modules, part 1.
Bruno Haible [Fri, 30 Aug 2024 15:59:13 +0000 (17:59 +0200)]
Trivial relicensing of macro-only modules, part 1.

* modules/link-follow (License): Change to unlimited.
* modules/rmdir-errno (License): Likewise.
* modules/unlink-busy (License): Likewise.
* modules/uptime (License): Likewise.
* modules/winsz-termios (License): Likewise.

8 months agodoc: Correct statement about license of m4/*.m4 files.
Bruno Haible [Fri, 30 Aug 2024 12:10:46 +0000 (14:10 +0200)]
doc: Correct statement about license of m4/*.m4 files.

* doc/gnulib-intro.texi (Copyright): For m4/*.m4 files, list also the
"GPL with Autoconf exception" as a possible license notice.

8 months agosigsegv: Clarify license of the *.m4 files.
Bruno Haible [Fri, 30 Aug 2024 11:41:14 +0000 (13:41 +0200)]
sigsegv: Clarify license of the *.m4 files.

* m4/sigaltstack.m4: In the license notice, clarify which version of the
GPL is meant.
* m4/stack-direction.m4: Likewise.

8 months agolibsigsegv: Relicense under GPLv2+.
Bruno Haible [Fri, 30 Aug 2024 10:44:03 +0000 (12:44 +0200)]
libsigsegv: Relicense under GPLv2+.

* modules/libsigsegv (License): Change to GPLv2+.

8 months agovma-prot: Add tests.
Bruno Haible [Thu, 29 Aug 2024 20:52:02 +0000 (22:52 +0200)]
vma-prot: Add tests.

* tests/test-vma-prot.c: New file.
* modules/vma-prot-tests: New file.

8 months agovma-prot: New module.
Bruno Haible [Thu, 29 Aug 2024 20:48:52 +0000 (22:48 +0200)]
vma-prot: New module.

* lib/vma-prot.h: New file.
* lib/vma-prot.c: New file.
* modules/vma-prot: New file.

8 months agovma-iter: Relicense under GPLv2+.
Bruno Haible [Thu, 29 Aug 2024 16:58:55 +0000 (18:58 +0200)]
vma-iter: Relicense under GPLv2+.

* modules/vma-iter (License): Change to GPLv2+.
* lib/vma-iter.h: Update license notice.
* lib/vma-iter.c: Likewise.

8 months agognulib-tool.py: Allow verifying license compatibility with GPLv2+.
Bruno Haible [Thu, 29 Aug 2024 16:32:35 +0000 (18:32 +0200)]
gnulib-tool.py: Allow verifying license compatibility with GPLv2+.

* pygnulib/GLInfo.py (GLInfo.usage): Document the --gpl option.
* pygnulib/main.py (main): Accept a --gpl option. Pass it to the
GLConfig.
* pygnulib/GLConfig.py (GLConfig): Add 'gpl' field and constructor
argument. Add getGPL, setGPL, resetGPL methods.
* m4/gnulib-tool.m4 (gl_GPL): New macro.
* doc/gnulib-tool.texi (Modified imports): Document the gl_GPL macro.
* pygnulib/GLImport.py (GLImport.__init__): Look for gl_GPL invocations
in gnulib-cache.m4.
(GLImport.actioncmd): Output --gpl option when option --gpl was given.
(GLImport.gnulib_cache): Emit a gl_GPL invocation when option --gpl was
given.
(GLImport.prepare): Do license compatibility checking when option --gpl
was given.
* pygnulib/GLModuleSystem.py: Update a comment.

8 months agognulib-tool: Fix description of --lgpl option (missed on 2021-06-04).
Bruno Haible [Thu, 29 Aug 2024 15:49:33 +0000 (17:49 +0200)]
gnulib-tool: Fix description of --lgpl option (missed on 2021-06-04).

* gnulib-tool.sh (func_usage): Remove "Also modify license template"
sentence.
* pygnulib/GLInfo.py (GLInfo.usage): Likewise.

8 months agoobstack-printf-gnu: Fix mistake (reported by check-AC_LIBOBJ).
Bruno Haible [Thu, 29 Aug 2024 14:07:24 +0000 (16:07 +0200)]
obstack-printf-gnu: Fix mistake (reported by check-AC_LIBOBJ).

* modules/obstack-printf-gnu (Files): Add lib/obstack_printf.c.

8 months agolibgmp-mpq: Add tests.
Marc Nieper-Wißkirchen [Thu, 29 Aug 2024 09:15:11 +0000 (11:15 +0200)]
libgmp-mpq: Add tests.

* modules/libgmp-mpq-tests: New file.
* tests/test-libgmp-mpq.c: New file.

8 months agolibgmp-mpq: New module.
Marc Nieper-Wißkirchen [Thu, 29 Aug 2024 09:10:21 +0000 (11:10 +0200)]
libgmp-mpq: New module.

* MODULES.html.sh: Mention libgmp-mpz and
libgmp-mpq.
* config/srclist.txt: Mention mini-mpq.c and mini-mpq.h.
* lib/mini-mpq-gnulib.c: New file.
* lib/mini-mpq.c: New upstream source file from
https://gmplib.org/repo/gmp/raw-file/tip/mini-gmp/mini-mpq.c.
* lib/mini-mpq.h: New upstream source file from
https://gmplib.org/repo/gmp/raw-file/tip/mini-gmp/mini-mpq.h.
* modules/libgmp-mpq: New module.
* modules/libgmp-mpz: Conditionally include mini-mpq.h in gmp.h.
* modules/libgmp: Add libgmp-mpq dependency.

8 months agoavoid GCC -Wmaybe-uninitialized false positives with LTO
Pádraig Brady [Wed, 28 Aug 2024 11:10:43 +0000 (12:10 +0100)]
avoid GCC -Wmaybe-uninitialized false positives with LTO

Avoids false warnings with GCC 14.2.1 with -flto

* lib/canonicalize.c: Initialize END_IDX.
* lib/getndelim2.c: Initialize C.

8 months agothreads-h: Don't override the C++ keyword 'thread_local'.
Bruno Haible [Wed, 28 Aug 2024 15:03:39 +0000 (17:03 +0200)]
threads-h: Don't override the C++ keyword 'thread_local'.

* lib/threads.in.h (thread_local): Don't define as a macro in C++ 11
or newer.

8 months agoautoupdate
Karl Berry [Wed, 28 Aug 2024 15:01:35 +0000 (08:01 -0700)]
autoupdate

8 months agolibgmp-mpz: New module, renamed from libgmp.
Bruno Haible [Wed, 28 Aug 2024 12:16:08 +0000 (14:16 +0200)]
libgmp-mpz: New module, renamed from libgmp.

* modules/libgmp-mpz: Renamed from modules/libgmp.
* modules/libgmp: New file.
* modules/libgmp-mpz-tests: Renamed from modules/libgmp-tests.
* tests/test-libgmp-mpz.c: Renamed from tests/test-libgmp.c.

8 months agodoc: Add more details about O_EXEC and O_SEARCH.
Bruno Haible [Wed, 28 Aug 2024 09:03:34 +0000 (11:03 +0200)]
doc: Add more details about O_EXEC and O_SEARCH.

* doc/posix-headers/fcntl.texi: Add platforms list and revisit note
about O_EXEC and O_SEARCH.

8 months agomcel: Fix compilation error with MSVC.
Bruno Haible [Tue, 27 Aug 2024 22:34:53 +0000 (00:34 +0200)]
mcel: Fix compilation error with MSVC.

* modules/builtin-expect (Description): Improve.
* m4/builtin-expect.m4: Improve comment.
* modules/mcel (Depends-on): Add builtin-expect.

8 months agosavewd: port to native MS-Windows
Paul Eggert [Tue, 27 Aug 2024 21:39:59 +0000 (14:39 -0700)]
savewd: port to native MS-Windows

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-08/msg00187.html
* lib/savewd.c (fork) [_WIN32 && !__CYGWIN]: New macro.
(savewd_save): Don’t fork on MS-Windows, or if O_SEARCH != O_RDONLY.

8 months agobcopy: Deprecate module.
Bruno Haible [Tue, 27 Aug 2024 21:11:26 +0000 (23:11 +0200)]
bcopy: Deprecate module.

* modules/bcopy (Status, Notice): Mark as deprecated.
* doc/pastposix-functions/bcopy.texi: Mention that this module does not
declare bcopy().

8 months agosimple-atomic: Fix a clang warning on native Windows.
Bruno Haible [Tue, 27 Aug 2024 21:01:33 +0000 (23:01 +0200)]
simple-atomic: Fix a clang warning on native Windows.

* lib/simple-atomic.c (atomic_compare_and_swap_ptr): Add a cast.

8 months agowrite-any-file: Don't reference an undefined function on native Windows.
Bruno Haible [Tue, 27 Aug 2024 20:50:05 +0000 (22:50 +0200)]
write-any-file: Don't reference an undefined function on native Windows.

* m4/write-any-file.m4 (): Remove test for <priv.h>, obsolete since
2009-05-03. Test for geteuid.
* lib/write-any-file.c (geteuid): Define a fallback.

8 months agomkdir-p: Don't reference an undefined function on native Windows.
Bruno Haible [Tue, 27 Aug 2024 20:28:36 +0000 (22:28 +0200)]
mkdir-p: Don't reference an undefined function on native Windows.

* m4/mkdir-p.m4 (gl_MKDIR_PARENTS): Test whether fchown exists.
* lib/dirchownmod.c (fchown): Define to a fallback if the system does
not have fchown.
(dirchownmod): Test HAVE_FCHOWN.

8 months agogetusershell: Don't completely ignore lines that contain a comment.
Bruno Haible [Tue, 27 Aug 2024 20:17:18 +0000 (22:17 +0200)]
getusershell: Don't completely ignore lines that contain a comment.

* lib/getusershell.c (getusershell): Truncate the line where a comment
starts, instead of ignoring the line entirely.

8 months agofts: Don't assume that a pointer is as wide as a 'long'.
Bruno Haible [Tue, 27 Aug 2024 20:08:00 +0000 (22:08 +0200)]
fts: Don't assume that a pointer is as wide as a 'long'.

* lib/fts.c (fts_sort): Cast pointers to 'uintptr_t', not to 'long'.

8 months agomkdir: Fix for use of posixcheck module on native Windows.
Bruno Haible [Tue, 27 Aug 2024 20:00:54 +0000 (22:00 +0200)]
mkdir: Fix for use of posixcheck module on native Windows.

* lib/sys_stat.in.h (mkdir): Give priority to the native Windows
definition over the GNULIB_POSIXCHECK redefinition.

8 months agowindows-spawn: Fix clang warning.
Bruno Haible [Tue, 27 Aug 2024 19:43:36 +0000 (21:43 +0200)]
windows-spawn: Fix clang warning.

* lib/windows-spawn.c (convert_CreateProcess_error): Remove unreachable
'break;' statements.

8 months agoImprove support for clang on Windows.
Bruno Haible [Tue, 27 Aug 2024 19:40:15 +0000 (21:40 +0200)]
Improve support for clang on Windows.

* lib/c++defs.h (_GL_CXXALIASWARN_2): Treat clang like gcc 4.2.
* lib/stdio.in.h (fwrite, fwrite_unlocked): Likewise.
* lib/warn-on-use.h (_GL_WARN_ON_USE, _GL_WARN_ON_USE_CXX): Likewise.
* lib/libc-config.h (__GNUC_PREREQ): Override glibc's definition to
handle clang in disguise.

8 months agoExplicitly exclude clang when we test for a GCC version >= 4.3.
Bruno Haible [Tue, 27 Aug 2024 14:20:16 +0000 (16:20 +0200)]
Explicitly exclude clang when we test for a GCC version >= 4.3.

Rationale: clang can disguise as any possible GCC version.

* m4/gnulib-common.m4 (gl_CC_GNULIB_WARNINGS): When testing __GNUC__,
exclude clang.
* lib/_Noreturn.h (_Noreturn): Likewise.
* lib/aligned-malloc.h (aligned_free, aligned_malloc): Likewise.
* lib/base32.h: Likewise.
* lib/base64.h: Likewise.
* lib/dfa.c (FALLTHROUGH): Likewise.
* lib/dirent.in.h (_GL_ATTRIBUTE_DEALLOC, opendir, fdopendir): Likewise.
* lib/intprops-internal.h: Likewise.
* lib/jit/cache.h (clear_cache): Likewise.
* lib/malloc.in.h (memalign): Likewise.
* lib/mcel.h: Likewise.
* lib/regex.h: Likewise.
* lib/stddef.in.h (_GL_HAS_BUILTIN_UNREACHABLE): Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_DEALLOC, fdopen, fopen, popen, tmpfile):
Likewise.
* lib/stdlib.in.h (_GL_ATTRIBUTE_DEALLOC, aligned_alloc, calloc,
canonicalize_file_name, malloc, realloc): Likewise.
* lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, strdup, strndup): Likewise.
* lib/verify.h: Likewise.
* lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, wcsdup): Likewise.
* lib/xalloc-oversized.h (xalloc_oversized): Likewise.
* lib/fenv-private.h (_FPU_GETCW, _FPU_SETCW, _FPU_GETFPSR,
_FPU_SETFPSR): When testing __GNUC__, exclude clang. Use different
builtins for clang.
* lib/hamt.h (GL_HAMT_THREAD_SAFE): When testing __GNUC__, exclude
clang. Enable for clang >= 4.
* lib/astrxfrm.c: Use _GL_GNUC_PREREQ.
* lib/readutmp.c: Likewise.
* lib/strftime.c: Likewise.
* tests/test-asyncsafe-linked_list-strong.c: Likewise.
* tests/test-asyncsafe-linked_list-weak.c: Likewise.
* tests/test-c-strtod-mt.c: Likewise.
* tests/test-c-strtof-mt.c: Likewise.
* tests/test-c-strtold-mt.c: Likewise.
* tests/test-gmtime_r-mt.c: Likewise.
* tests/test-intprops.c: Likewise.
* tests/test-limits-h.c: Likewise.
* tests/test-localtime_r-mt.c: Likewise.
* tests/test-memrchr.c: Likewise.
* tests/test-nl_langinfo-mt.c: Likewise.
* tests/test-setlocale_null-mt-all.c: Likewise.
* tests/test-setlocale_null-mt-one.c: Likewise.
* tests/test-statat.c: Likewise.
* tests/test-xvasprintf.c: Likewise.

8 months agodoc: Update about psignal.
Bruno Haible [Tue, 27 Aug 2024 16:45:22 +0000 (18:45 +0200)]
doc: Update about psignal.

Reported by Eric Gallager <egall@gwmail.gwu.edu> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00177.html>.

* doc/posix-functions/psignal.texi: Mention the Solaris problem and the
first parameter type.

8 months agoreadutmp: In systemd mode, show sessions of type "web".
Bruno Haible [Tue, 27 Aug 2024 09:46:33 +0000 (11:46 +0200)]
readutmp: In systemd mode, show sessions of type "web".

Reported by Allison Karlitskaya <allison.karlitskaya@redhat.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-08/msg00160.html>.

* lib/readutmp.c (read_utmp_from_systemd): For a systemd session of type
"web", add a single USER_PROCESS entry.

8 months agoFix a test failure from a clang that masquerades as gcc 13.
Bruno Haible [Mon, 26 Aug 2024 22:49:07 +0000 (00:49 +0200)]
Fix a test failure from a clang that masquerades as gcc 13.

* tests/test-fenv-except-trapping-2.c (main): Skip the '4' test on
clang, since clang 17 still generates buggy comparisons, like gcc
versions < 8.

8 months agoFix some of the warnings from a clang that masquerades as gcc 13.
Bruno Haible [Mon, 26 Aug 2024 22:19:14 +0000 (00:19 +0200)]
Fix some of the warnings from a clang that masquerades as gcc 13.

* lib/c-stack.c: Use _GL_GNUC_PREREQ to test for the gcc version.
* lib/canonicalize.c: Likewise.
* lib/diffseq.h: Likewise.
* lib/file-has-acl.c: Likewise.
* lib/freopen-safer.c: Likewise.
* lib/getndelim2.c: Likewise.
* lib/mini-gmp-gnulib.c: Likewise.
* lib/propername.c: Likewise.
* lib/quotearg.c: Likewise.
* lib/savedir.c: Likewise.
* lib/vasnprintf.c: Likewise.
* tests/test-argmatch.c: Likewise.
* tests/test-dup2.c: Likewise.
* tests/test-explicit_bzero.c: Likewise.
* tests/test-fcntl.c: Likewise.
* tests/test-fopen.h: Likewise.
* tests/test-getdtablesize.c: Likewise.
* tests/test-getgroups.c: Likewise.
* tests/test-listen.c: Likewise.
* tests/test-localename.c: Likewise.
* tests/test-memset_explicit.c: Likewise.
* tests/test-open.h: Likewise.
* tests/test-perror2.c: Likewise.
* tests/test-select.h: Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD): Don't use
gnu_printf with clang.
* lib/string-buffer.h: Likewise.
* lib/textstyle.in.h: Likewise.

8 months agorelocatable-prog: Fix config.libpath failure (regression 2024-08-24).
Bruno Haible [Mon, 26 Aug 2024 19:29:03 +0000 (21:29 +0200)]
relocatable-prog: Fix config.libpath failure (regression 2024-08-24).

* build-aux/config.libpath: Expect 2 arguments, not 1.

8 months agoFix compilation errors with clang that masquerades as gcc 13.
Bruno Haible [Mon, 26 Aug 2024 19:13:50 +0000 (21:13 +0200)]
Fix compilation errors with clang that masquerades as gcc 13.

Reported by Sam James and Paul Eggert.

* m4/gnulib-common.m4 (gl_COMMON_BODY): For _GL_GNUC_PREREQ, ignore the
values of __GNUC__ and __GNUC_MINOR__ defined by clang.
* lib/warn-on-use.h (_GL_WARN_ON_USE, _GL_WARN_ON_USE_CXX): Don't treat
clang like GCC.
* lib/wchar.in.h (wmemchr, wcschr, wcsrchr, wcspbrk, wcsstr): Disable
the _GL_CXXALIASWARN1 and _GL_CXXALIASWARN invocations for masquerading
clang++.

8 months agodiffseq: don’t worry about clang
Paul Eggert [Sun, 25 Aug 2024 22:18:45 +0000 (15:18 -0700)]
diffseq: don’t worry about clang

* lib/diffseq.h: Stop worrying about __clang__ for pragmas.
This basically reverts the previous change to this file.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-08/msg00145.html