]> Savannah Git Hosting - gnulib.git/log
gnulib.git
14 months agosetlocale-null: Refactor.
Bruno Haible [Thu, 15 Feb 2024 08:47:08 +0000 (09:47 +0100)]
setlocale-null: Refactor.

* lib/setlocale_null.c
(setlocale_null_r_with_lock): Renamed from setlocale_null_with_lock.
(setlocale_null_r_unlocked): Renamed from setlocale_null_unlocked.
(setlocale_null_unlocked): Renamed from setlocale_null_androidfix.

14 months agolocalename-unsafe: New module.
Bruno Haible [Thu, 15 Feb 2024 18:23:25 +0000 (19:23 +0100)]
localename-unsafe: New module.

* lib/localename.h (gl_locale_name_unsafe, gl_locale_name_thread_unsafe,
gl_locale_name_posix_unsafe): New declarations.
* lib/localename-unsafe.c: New file, based on lib/localename.c.
(gl_locale_name_thread_unsafe): Renamed from gl_locale_name_thread.
(gl_locale_name_posix_unsafe): Renamed from gl_locale_name_posix.
(gl_locale_name_unsafe): Renamed from gl_locale_name.
(struniq): Define only on platforms that need it.
* lib/localename.c: Remove code that was moved to
lib/localename-unsafe.c.
(gl_locale_name_thread): Just call gl_locale_name_thread_unsafe and
struniq.
(gl_locale_name_posix): Just call gl_locale_name_posix_unsafe and
struniq.
* lib/locale.in.h: Test @GNULIB_LOCALENAME_UNSAFE@ instead of
@GNULIB_LOCALENAME@.
* m4/locale_h.m4 (gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_LOCALENAME_UNSAFE instead of GNULIB_LOCALENAME.
* modules/locale (Makefile.am): Substitute GNULIB_LOCALENAME_UNSAFE
instead of GNULIB_LOCALENAME.
* m4/localename.m4 (gl_LOCALENAME_UNSAFE): Renamed from gl_LOCALENAME.
* modules/localename-unsafe: New file, based on modules/localename.
* modules/localename: Greatly simplify.
(Depends-on): Add localename-unsafe.

14 months agolocalename: Refactor.
Bruno Haible [Thu, 15 Feb 2024 16:55:39 +0000 (17:55 +0100)]
localename: Refactor.

* lib/struniq.h: New file, extracted from lib/localename.c.
* lib/localename.c: Include it.
* modules/localename (Files): Add lib/struniq.h.

14 months agolocalename: Speed up lookup of the LC_MESSAGES name on AIX ≥ 7.2.
Bruno Haible [Thu, 15 Feb 2024 15:00:59 +0000 (16:00 +0100)]
localename: Speed up lookup of the LC_MESSAGES name on AIX ≥ 7.2.

* m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): On AIX, test
for the 'locale_name' member.
* lib/localename.c (get_locale_t_name): For the LC_MESSAGES category,
use the 'locale_name' member if available.

14 months agolocalename: Add more comments.
Bruno Haible [Thu, 15 Feb 2024 13:35:53 +0000 (14:35 +0100)]
localename: Add more comments.

* m4/intl-thread-locale.m4: Document expected configuration results.
* doc/posix-functions/uselocale.texi: Update platforms list.
* lib/localename.c: Likewise.

14 months agolocalename: Add parameter validation.
Bruno Haible [Thu, 15 Feb 2024 09:48:50 +0000 (10:48 +0100)]
localename: Add parameter validation.

* lib/localename.c (get_locale_t_name, gl_locale_name_thread_unsafe,
gl_locale_name_thread, gl_locale_name_posix, gl_locale_name): Verify
that the category argument is not LC_ALL.

14 months agolocalename: Notice setlocale() invocations on more platforms.
Bruno Haible [Thu, 15 Feb 2024 00:33:51 +0000 (01:33 +0100)]
localename: Notice setlocale() invocations on more platforms.

* lib/localename.c (HAVE_LOCALE_NULL): Define also on musl, FreeBSD,
NetBSD, Solaris, Haiku.
* modules/localename (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.
* tests/test-localename.c (C_CANONICALIZED): New macro, for Haiku.
(is_default): New function, for musl libc and Haiku.
(test_locale_name, test_locale_name_posix): Use these definitions.
* modules/localename-tests (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.

14 months agoDon't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv.
Bruno Haible [Wed, 14 Feb 2024 22:44:28 +0000 (23:44 +0100)]
Don't treat Apple's new Citrus/FreeBSD-based iconv like GNU libiconv.

* m4/iconv_open.m4 (gl_FUNC_ICONV_OPEN): Don't treat the bastard Apple
iconv like GNU libiconv.
* lib/striconv.c (mem_cd_iconv, str_cd_iconv): Likewise.
* lib/striconveh.c (iconv_carefully, iconv_carefully_1,
mem_cd_iconveh_internal): Likewise.
* lib/propername.c (proper_name_utf8): Likewise.
* lib/unicodeio.c (unicode_to_mb): Likewise.
* lib/uniconv/u16-conv-from-enc.c (UTF16_NAME): Likewise.
* lib/uniconv/u16-conv-to-enc.c (UTF16_NAME): Likewise.
* lib/uniconv/u16-strconv-to-enc.c (UTF16_NAME): Likewise.
* lib/uniconv/u32-conv-from-enc.c (UTF32_NAME): Likewise.
* lib/uniconv/u32-conv-to-enc.c (UTF32_NAME): Likewise.
* lib/uniconv/u32-strconv-to-enc.c (UTF32_NAME): Likewise.
* tests/test-striconveh.c (main): Likewise.
* tests/test-striconveha.c (main): Likewise.
* tests/uniconv/test-u8-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise.

14 months agoImprove support of Citrus/FreeBSD iconv.
Bruno Haible [Wed, 14 Feb 2024 22:16:15 +0000 (23:16 +0100)]
Improve support of Citrus/FreeBSD iconv.

* lib/striconveh.c (iconveh_open): Use //TRANSLIT with all iconv
implementations that support it.
* lib/striconveha.c (mem_iconveha, str_iconveha): Likewise.
* lib/propername.c (proper_name_utf8): Likewise.

14 months agoisnan: Fix compilation error in C++ mode on macOS 14.4 / Xcode 15.2.
Bruno Haible [Wed, 14 Feb 2024 19:08:15 +0000 (20:08 +0100)]
isnan: Fix compilation error in C++ mode on macOS 14.4 / Xcode 15.2.

Reported by Paul E Reimer <reimer@anl.gov> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-02/msg00002.html>.

* lib/math.in.h (GNULIB_NAMESPACE_LACKS_ISNAN): Define also on macOS
with clang ≥ 14.

14 months agonstrftime: allow opt-out of AM/PM adjustment
Paul Eggert [Wed, 14 Feb 2024 06:29:27 +0000 (22:29 -0800)]
nstrftime: allow opt-out of AM/PM adjustment

For Emacs I would rather avoid bringing in the Gnulib locking code,
since Emacs has its own idea about locks and its main engine is
single-threaded anyway.
Provide a way to use the nstrftime module while avoiding its
recently-added localename dependency, which entails locking code.
(It’s not clear to me that the locking code is needed for nstrftime,
as NetBSD has strftime_z and Solaris locales could be inspected in
some thread-safe way, e.g., by probing strftime month names.
Anyway, all that’s more hassle than I want to put up with right now
for the trivial matter of AM/PM behavior.)
* lib/strftime.c (REQUIRE_GNUISH_STRFTIME_AM_PM):
New macro, which can be overridden by config.h.
(should_remove_ampm, __strftime_internal):
Use it instead of !USE_C_LOCALE when deciding to
implement Gnuish AM/PM behavior.

14 months agouniwidth/width tests: Update unit test for last commit.
Bruno Haible [Tue, 13 Feb 2024 16:40:15 +0000 (17:40 +0100)]
uniwidth/width tests: Update unit test for last commit.

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

14 months agouniwidth/width: Assign width 1 to prepended concatenation marks.
Bruno Haible [Mon, 12 Feb 2024 17:50:13 +0000 (18:50 +0100)]
uniwidth/width: Assign width 1 to prepended concatenation marks.

Suggested by Jules Bertholet <julesbertholet@quoi.xyz> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00093.html>.

* lib/gen-uni-tables.c (is_nonspacing): For characters with property
Prepended_Concatenation_Mark, return false instead of true.
* lib/uniwidth/width0.h: Regenerated. This assigns width 1 to the
characters U+0600..U+0605, U+06DD, U+070F, U+0890..U+0891, U+08E2,
U+110BD, U+110CD.
* modules/uniwidth/width (configure.ac): Bump required libunistring
version.
* modules/uniwidth/u8-width (configure.ac): Likewise.
* modules/uniwidth/u8-strwidth (configure.ac): Likewise.
* modules/uniwidth/u16-width (configure.ac): Likewise.
* modules/uniwidth/u16-strwidth (configure.ac): Likewise.
* modules/uniwidth/u32-width (configure.ac): Likewise.
* modules/uniwidth/u32-strwidth (configure.ac): Likewise.

14 months agoImplement a new property, added by Unicode 9.0.0.
Bruno Haible [Mon, 12 Feb 2024 17:18:43 +0000 (18:18 +0100)]
Implement a new property, added by Unicode 9.0.0.

* lib/gen-uni-tables.c (is_property_prepended_concatenation_mark): New
function.
(output_properties): Output also the property
prepended_concatenation_mark.
* lib/unictype.in.h (UC_PROPERTY_PREPENDED_CONCATENATION_MARK,
uc_is_property_prepended_concatenation_mark): New declarations.
* m4/unictype_h.m4 (gl_UNICTYPE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK.
* modules/unictype/base (Makefile.am): Substitute
GNULIB_UNICTYPE_PROPERTY_PREPENDED_CONCATENATION_MARK.
* lib/unictype/pr_prepended_concatenation_mark.c: New file.
* lib/unictype/pr_prepended_concatenation_mark.h: New generated file.
* modules/unictype/property-prepended-concatenation-mark: New file.
* tests/unictype/test-pr_prepended_concatenation_mark.c: New generated
file.
* modules/unictype/property-prepended-concatenation-mark-tests: New
file.
* lib/unictype/pr_byname.gperf: Add prepended_concatenation_mark.
* lib/unictype/pr_byname.c
(UC_PROPERTY_INDEX_PREPENDED_CONCATENATION_MARK): New enum item.
(uc_property_byname): Handle it.
* modules/unictype/property-byname (Depends-on): Add
unictype/property-prepended-concatenation-mark.
* modules/unictype/property-all (Depends-on): Likewise.
* MODULES.html.sh (func_all_modules): Add
unictype/property-prepended-concatenation-mark.

14 months agoposixtm tests: Fix reference to undefined module (regr. 2024-02-09).
Bruno Haible [Mon, 12 Feb 2024 13:41:04 +0000 (14:41 +0100)]
posixtm tests: Fix reference to undefined module (regr. 2024-02-09).

* modules/posixtm-tests (Depends-on): Remove strftime. Add
strftime-fixes.

14 months agolimits-h: Fix BOOL_MAX value.
Bruno Haible [Mon, 12 Feb 2024 13:02:33 +0000 (14:02 +0100)]
limits-h: Fix BOOL_MAX value.

* lib/limits.in.h (BOOL_MAX): Define to 1, not to 2^BOOL_WIDTH-1.
* tests/test-limits-h.c (main): Change expected value of BOOL_MAX.

14 months agostdalign: Document a clang 17 bug.
Bruno Haible [Mon, 12 Feb 2024 12:16:32 +0000 (13:16 +0100)]
stdalign: Document a clang 17 bug.

* doc/posix-headers/stdalign.texi: Mention a clang 17 bug.

14 months agogetcwd, getcwd-lgpl: Fix configure test.
Bruno Haible [Mon, 12 Feb 2024 11:44:08 +0000 (12:44 +0100)]
getcwd, getcwd-lgpl: Fix configure test.

* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Don't redeclare getcwd().

14 months agopthread_mutex_timedlock, pthread-spin: Fix configure test.
Florian Weimer [Mon, 12 Feb 2024 11:18:34 +0000 (12:18 +0100)]
pthread_mutex_timedlock, pthread-spin: Fix configure test.

* m4/pthread_mutex_timedlock.m4 (gl_FUNC_PTHREAD_MUTEX_TIMEDLOCK): Pass
a pointer of the correct type to pthread_mutex_timedlock.
* m4/pthread-spin.m4 (gl_PTHREAD_SPIN): Pass a pointer of the correct
type to pthread_spin_init.

Copyright-paperwork-exempt: Yes

14 months agoFulfil the obligations of the Unicode license.
Bruno Haible [Sun, 11 Feb 2024 18:54:47 +0000 (19:54 +0100)]
Fulfil the obligations of the Unicode license.

* lib/gen-uni-tables.c: Prepend the Unicode license when copying
NameAliases.txt, UnicodeData.txt, NormalizationTest.txt,
GraphemeBreakTest.txt, WordBreakTest.txt.
* tests/unigbrk/GraphemeBreakTest.txt: Prepend the Unicode license.
* tests/uniname/NameAliases.txt: Likewise.
* tests/uniname/UnicodeData.txt: Likewise.
* tests/uninorm/NormalizationTest.txt: Likewise.
* tests/uniwbrk/WordBreakTest.txt: Likewise.
* tests/uniname/HangulSyllableNames.txt: Add public-domain notice.

14 months agotime_r: Add tests.
Bruno Haible [Sun, 11 Feb 2024 10:23:14 +0000 (11:23 +0100)]
time_r: Add tests.

* lib/time_r.c: Add comment.
* tests/test-gmtime_r.c: New file.
* tests/test-gmtime_r-mt.c: New file, based on
tests/test-nl_langinfo-mt.c.
* tests/test-localtime_r.c: New file.
* tests/test-localtime_r-mt.c: New file, based on
tests/test-nl_langinfo-mt.c.
* modules/time_r-tests: New file.

14 months agodoc: improve warnings about ctime etc.
Paul Eggert [Sun, 11 Feb 2024 01:53:34 +0000 (17:53 -0800)]
doc: improve warnings about ctime etc.

* doc/posix-functions/asctime.texi (asctime):
* doc/posix-functions/asctime_r.texi (asctime_r):
Say why these functions are typically used mistakenly.
* doc/posix-functions/ctime.texi (ctime):
* doc/posix-functions/ctime_r.texi (ctimef):
Say that they can dump core due to an internal null pointer, too.
* doc/posix-functions/ctime.texi (ctime):
Don’t recommend ctime_r.

14 months agoautoupdate
Karl Berry [Sat, 10 Feb 2024 15:01:28 +0000 (07:01 -0800)]
autoupdate

14 months agohavelib: Add support for NetBSD/sparc64.
Bruno Haible [Sat, 10 Feb 2024 10:17:47 +0000 (11:17 +0100)]
havelib: Add support for NetBSD/sparc64.

* m4/lib-prefix.m4 (AC_LIB_PREPARE_MULTILIB): On NetBSD/sparc64 in
32-bit mode, search for libraries in /usr/lib/sparc.

14 months agoctime, localtime, tzset, wcsftime: Make multithread-safe.
Bruno Haible [Fri, 9 Feb 2024 19:42:53 +0000 (20:42 +0100)]
ctime, localtime, tzset, wcsftime: Make multithread-safe.

* lib/ctime.c: Include <wchar.h>.
(rpl_ctime): Modify _environ and _wenviron without using _putenv.
* lib/localtime.c: Include <wchar.h>.
(rpl_localtime): Modify _environ and _wenviron without using _putenv.
* lib/tzset.c: Include <wchar.h>.
(rpl_tzset): Modify _environ and _wenviron without using _putenv.
* lib/wcsftime.c (rpl_wcsftime): Likewise.

14 months agostrftime: Remove module, deprecated in 2017.
Bruno Haible [Fri, 9 Feb 2024 16:39:42 +0000 (17:39 +0100)]
strftime: Remove module, deprecated in 2017.

* modules/strftime: Remove file.
* NEWS: Mention it.

14 months agoAvoid suboptimal definition of _GL_HAS_ATTRIBUTE on FreeBSD/sparc64.
Bruno Haible [Fri, 9 Feb 2024 16:28:31 +0000 (17:28 +0100)]
Avoid suboptimal definition of _GL_HAS_ATTRIBUTE on FreeBSD/sparc64.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Define _GL_HAS_ATTRIBUTE only
once.

14 months agonstrtime, c-nstrftime tests: Strengthen the tests.
Bruno Haible [Thu, 8 Feb 2024 14:51:55 +0000 (15:51 +0100)]
nstrtime, c-nstrftime tests: Strengthen the tests.

* tests/test-nstrftime.h (FUNC_CHECKED): New function.
(posixtm_test, tzalloc_test, quarter_test, errno_test, locales_test):
Invoke FUNC_CHECKED instead of FUNC.

14 months agonstrtime: Fix %p, %P, %r directives' results on NetBSD, Solaris.
Bruno Haible [Thu, 8 Feb 2024 14:34:34 +0000 (15:34 +0100)]
nstrtime: Fix %p, %P, %r directives' results on NetBSD, Solaris.

* lib/strftime.c: Include <locale.h>, localename.h.
(should_remove_ampm): New function.
(__strftime_internal): On NetBSD and Solaris, remove the AM/PM indicator
from the %p, %r directives' results in specific locales.
* modules/nstrftime (Depends-on): Add localename.
* tests/test-nstrftime.h (locales_test): Update the expected result of
the %r directive.
* doc/posix-functions/strftime.texi: Mention the problem of the %p and
%r directives on NetBSD and Solaris.

14 months agonstrtime, c-nstrftime: Fix %c directive's result on NetBSD, Solaris.
Bruno Haible [Thu, 8 Feb 2024 13:52:06 +0000 (14:52 +0100)]
nstrtime, c-nstrftime: Fix %c directive's result on NetBSD, Solaris.

* doc/posix-functions/strftime.texi: Mention this as a restriction of
strftime.

14 months agonstrtime, c-nstrftime: Fix %c directive's result on NetBSD, Solaris.
Bruno Haible [Thu, 8 Feb 2024 11:48:14 +0000 (12:48 +0100)]
nstrtime, c-nstrftime: Fix %c directive's result on NetBSD, Solaris.

* lib/strftime.c (__strftime_internal): On NetBSD and Solaris, remove
the last word of the %c directive's result if it looks like a time zone.

14 months agoc-nstrftime: Add tests.
Bruno Haible [Thu, 8 Feb 2024 00:24:12 +0000 (01:24 +0100)]
c-nstrftime: Add tests.

* tests/test-c-nstrftime.c: New file, based on tests/test-nstrftime.c.
* tests/test-c-nstrftime-1.sh: New file, based on
tests/test-nstrftime-1.sh.
* tests/test-c-nstrftime-2.sh: New file, based on
tests/test-nstrftime-2.sh.
* modules/c-nstrftime-tests: New file.

14 months agoc-nstrftime: New module.
Bruno Haible [Thu, 8 Feb 2024 00:09:08 +0000 (01:09 +0100)]
c-nstrftime: New module.

Suggested by Paul Eggert.

* lib/strftime.h (c_nstrftime): New declaration.
* lib/c-nstrftime.c: New file.
* lib/strftime.c (FPRINTFTIME): Move fallback definition before its
first use.
(USE_C_LOCALE): Add fallback definition.
If USE_C_LOCALE is set, include c-ctype.h instead of <ctype.h>.
Conditionally include <locale.h>.
(TOUPPER, TOLOWER): Define differently if USE_C_LOCALE is set.
(c_locale_cache, c_locale): New definitions, copied from lib/c-strtod.c.
(c_weekday_names, c_month_names): New variables, based on
glibc/time/strftime_l.c.
(__strftime_internal): Define a_wkday, aw_len, f_wkday, a_month, am_len,
f_month, ampm, ap_len differently for USE_C_LOCALE. Avoid a
'goto underlying_strftime' if USE_C_LOCALE && !HAVE_STRFTIME_L. Make the
strftime fallback declaration ISO C 23 compliant. If USE_C_LOCALE, use
strftime_l() with the C locale object instead of strftime().
* m4/c-nstrftime.m4: New file, based on m4/nstrftime.m4.
* modules/c-nstrftime: New file, based on modules/nstrftime.

14 months agonstrftime: Add tests of all directives, also in non-trivial locales.
Bruno Haible [Wed, 7 Feb 2024 22:53:09 +0000 (23:53 +0100)]
nstrftime: Add tests of all directives, also in non-trivial locales.

* tests/test-nstrftime.h (language_t): New type.
(locales_test): New function.
* tests/test-nstrftime.c: Include <locale.h>, <stdlib.h>.
(main): Invoke setlocale and locales_test.
* tests/test-nstrftime-1.sh: New file.
* tests/test-nstrftime-2.sh: New file, based on tests/test-strtod1.sh.
* modules/nstrftime-tests (Files): Add them. Add m4/locale-fr.m4,
m4/codeset.m4, m4/musl.m4.
(configure.ac): Invoke gt_LOCALE_FR, gt_LOCALE_FR_UTF8, gl_MUSL_LIBC.
(Makefile.am): Link test-nstrftime with $(SETLOCALE_LIB). Test
test-nstrftime-*.sh instead of test-nstrftime.

14 months agonstrftime: Work around strftime bug with %r on macOS and FreeBSD.
Bruno Haible [Wed, 7 Feb 2024 22:34:28 +0000 (23:34 +0100)]
nstrftime: Work around strftime bug with %r on macOS and FreeBSD.

* lib/strftime.c (__strftime_internal): For %r, don't use the underlying
strftime() directly.
* doc/posix-functions/strftime.texi: Mention the %r bug.

14 months agoAssume ‘long long’ support
Paul Eggert [Wed, 7 Feb 2024 21:01:09 +0000 (13:01 -0800)]
Assume ‘long long’ support

* modules/strtoimax, modules/strtoumax (Depends-on):
Assume the compiler supports ‘long long’.
This was overlooked in the 2019-12-22 patch
<https://lists.gnu.org/r/bug-gnulib/2019-12/msg00190.html>.

14 months agonstrftime: Fix typo in documentation.
Bruno Haible [Wed, 7 Feb 2024 15:57:15 +0000 (16:57 +0100)]
nstrftime: Fix typo in documentation.

Reported by Tim Rice <tim@multitalents.net>.

* lib/strftime.h (nstrftime): Fix typo in comment.

14 months agonstrftime tests: Avoid test failures on DragonFly BSD.
Bruno Haible [Wed, 7 Feb 2024 15:50:27 +0000 (16:50 +0100)]
nstrftime tests: Avoid test failures on DragonFly BSD.

* tests/test-nstrftime.h (LT): Disable specific test cases also on
DragonFly BSD.

14 months agonstrftime: Modernize.
Bruno Haible [Wed, 7 Feb 2024 12:37:17 +0000 (13:37 +0100)]
nstrftime: Modernize.

* lib/strftime.c (__strftime_internal): Make the strftime fallback
declaration ISO C 23 compliant.

14 months agonstrftime tests: Avoid test failures on FreeBSD, NetBSD, Android.
Bruno Haible [Wed, 7 Feb 2024 11:46:09 +0000 (12:46 +0100)]
nstrftime tests: Avoid test failures on FreeBSD, NetBSD, Android.

* tests/test-nstrftime.h (LT): Disable specific test cases on FreeBSD,
NetBSD, Android.

14 months agonstrftime tests: Allow reuse with another function.
Bruno Haible [Wed, 7 Feb 2024 11:38:44 +0000 (12:38 +0100)]
nstrftime tests: Allow reuse with another function.

* tests/test-nstrftime.h: New file, extracted from
tests/test-nstrftime.c.
(FUNC_NAME, STRINGIFY): New macros.
(posixtm_test, tzalloc_test, quarter_test, errno_test): Use FUNC or
FUNC_NAME instead of nstrftime.
(quarter_test): Rename local variable 'result' to 'fail'.
* tests/test-nstrftime.c: Remove code that moved to test-nstrftime.h.
Include test-nstrftime.h.
(STREQ): Remove redundant macro.
* modules/nstrftime-tests (Files): Add tests/test-nstrftime.h.

14 months agonstrftime: Document the nstrftime function.
Bruno Haible [Wed, 7 Feb 2024 10:52:38 +0000 (11:52 +0100)]
nstrftime: Document the nstrftime function.

* lib/strftime.h (nstrftime): Add more comments.

14 months agonl_langinfo: Fix fallback list of month names (regression 2014-07-07).
Bruno Haible [Tue, 6 Feb 2024 20:59:01 +0000 (21:59 +0100)]
nl_langinfo: Fix fallback list of month names (regression 2014-07-07).

* lib/nl_langinfo.c (nl_langinfo): In the implementation for native
Windows, fix the results for MON_8..MON_12, ALTMON_8..ALTMON_12,
ABMON_8..ABMON_12.

14 months agonstrftime: Merge glibc strftime changes.
Bruno Haible [Tue, 6 Feb 2024 20:32:13 +0000 (21:32 +0100)]
nstrftime: Merge glibc strftime changes.

This incorporates:
2023-02-07 Use 64-bit time_t interfaces in strftime and strptime

* lib/strftime.c [_LIBC] (time_t, __gmtime_r, mktime): Define as macros.
* config/srclist.txt: Update comment regarding glibc/time/strftime_l.c.

14 months agonstrftime, fprintftime: Simplify.
Bruno Haible [Tue, 6 Feb 2024 16:08:16 +0000 (17:08 +0100)]
nstrftime, fprintftime: Simplify.

* lib/strftime.c: Renamed from lib/nstrftime.c.
(my_strftime): Don't define here.
* lib/nstrftime.c: New file.
* lib/fprintftime.c (my_strftime): New macro.
Include strftime.c, not nstrftime.c.
* m4/nstrftime.m4 (gl_FUNC_GNU_STRFTIME): Don't define my_strftime in
config.h.
* modules/nstrftime (Files): Add lib/strftime.c.
* modules/fprintftime (Files): Likewise.
* config/srclist.txt: Update comment regarding glibc/time/strftime.c.

14 months agoFurther improve cross-compilation for midipix.
Bruno Haible [Tue, 6 Feb 2024 08:46:07 +0000 (09:46 +0100)]
Further improve cross-compilation for midipix.

Reported by Ørjan Malde <red@foxi.me>.

* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Improve cross-compilation guess
for midipix.

14 months agoctime: improve doc
Paul Eggert [Tue, 6 Feb 2024 06:48:29 +0000 (22:48 -0800)]
ctime: improve doc

* doc/posix-functions/asctime.texi (asctime):
* doc/posix-functions/asctime_r.texi (asctime_r):
* doc/posix-functions/ctime_r.texi (ctime_r):
* doc/posix-functions/ctime.texi (ctime):
Mention locale problem of strftime more consistently.  Improve
wording.  For ctime and ctime_r, mention that localtime_r can
fail.
* doc/posix-functions/ctime.texi (ctime): Move history section
to end and spiff up a bit.
* doc/posix-functions/ctime_r.texi (ctime_r): Omit commentary that
assumes traditional SunOS ctime_r API; it was confusing and not
useful for Gnulib apps, which assume the POSIX API.

14 months agoFurther improve cross-compilation for midipix.
Bruno Haible [Mon, 5 Feb 2024 23:41:56 +0000 (00:41 +0100)]
Further improve cross-compilation for midipix.

Based on patch by Ørjan Malde <red@foxi.me> from
<https://lists.gnu.org/archive/html/bug-gnulib/2024-02/msg00004.html>.

* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Add cross-compilation guess for
midipix.
* m4/rename.m4 (gl_FUNC_RENAME): Likewise.
* m4/truncate.m4 (gl_FUNC_TRUNCATE): Likewise.
* m4/utime.m4 (gl_FUNC_UTIME): Likewise.
* m4/utimens.m4 (gl_UTIMENS): Likewise.
* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Likewise.

14 months agodoc: Extend doc of *ctime functions.
Paul Eggert [Mon, 5 Feb 2024 14:18:48 +0000 (15:18 +0100)]
doc: Extend doc of *ctime functions.

* doc/posix-functions/ctime.texi (ctime): Document why we got into
this mess.
* doc/posix-functions/asctime.texi (asctime):
* doc/posix-functions/asctime_r.texi (asctime_r):
* doc/posix-functions/ctime_r.texi (ctime_r):
Refer to ctime’s buffer overflow doc.

14 months agosnippet/warn-on-use: Add comment.
Bruno Haible [Mon, 5 Feb 2024 14:02:21 +0000 (15:02 +0100)]
snippet/warn-on-use: Add comment.

* lib/warn-on-use.h: Document a restriction of _GL_WARN_ON_USE.

15 months agoxalloc-oversized: omit unnecessary cast
Paul Eggert [Sun, 4 Feb 2024 07:53:13 +0000 (23:53 -0800)]
xalloc-oversized: omit unnecessary cast

* lib/xalloc-oversized.h (__xalloc_oversized): Omit unnecessary
cast of a positive in-range value to size_t.  This seems to be
left over from an older version of the code.

15 months agoglob: port better to C23
Paul Eggert [Sun, 4 Feb 2024 06:06:41 +0000 (22:06 -0800)]
glob: port better to C23

* lib/glob.c: Include <stdckdint.h>.
(size_add_wrapv): Remove.  All uses replaced by ckd_add.
* modules/glob: Depend on stdckdint.

15 months agoctime: fix false positive
Paul Eggert [Sat, 3 Feb 2024 20:05:17 +0000 (12:05 -0800)]
ctime: fix false positive

Problem reported by Bjarni Ingi Gislason in:
https://lists.gnu.org/r/bug-gnulib/2024-02/msg00006.html
* lib/time.in.h (ctime): Do not warn about ctime portability,
as there is a more serious warning about it crashing,
and the two warning directives can cause false alarms.

15 months agoImplement 3 new properties, added by Unicode 15.1.0.
Bruno Haible [Wed, 31 Jan 2024 15:43:45 +0000 (16:43 +0100)]
Implement 3 new properties, added by Unicode 15.1.0.

* lib/gen-uni-tables.c (is_property_id_compat_math_start,
is_property_id_compat_math_continue, is_property_ids_unary_operator):
New functions.
(output_properties): Output also the properties id_compat_math_start,
id_compat_math_continue, ids_unary_operator.
* lib/unictype.in.h (UC_PROPERTY_ID_COMPAT_MATH_START,
UC_PROPERTY_ID_COMPAT_MATH_CONTINUE, UC_PROPERTY_IDS_UNARY_OPERATOR,
uc_is_property_id_compat_math_start,
uc_is_property_id_compat_math_continue,
uc_is_property_ids_unary_operator): New declarations.
* m4/unictype_h.m4 (gl_UNICTYPE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE,
GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE,
GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE.
* modules/unictype/base (Makefile.am): Substitute
GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_START_DLL_VARIABLE,
GNULIB_UNICTYPE_PROPERTY_ID_COMPAT_MATH_CONTINUE_DLL_VARIABLE,
GNULIB_UNICTYPE_PROPERTY_IDS_UNARY_OPERATOR_DLL_VARIABLE.
* lib/unictype/pr_id_compat_math_continue.c: New file.
* lib/unictype/pr_id_compat_math_continue.h: New generated file.
* lib/unictype/pr_id_compat_math_start.c: New file.
* lib/unictype/pr_id_compat_math_start.h: New generated file.
* lib/unictype/pr_ids_unary_operator.c: New file.
* modules/unictype/property-id-compat-math-continue: New file.
* modules/unictype/property-id-compat-math-start: New file.
* modules/unictype/property-ids-unary-operator: New file.
* tests/unictype/test-pr_id_compat_math_continue.c: New generated file.
* tests/unictype/test-pr_id_compat_math_start.c: New generated file.
* tests/unictype/test-pr_ids_unary_operator.c: New generated file.
* modules/unictype/property-id-compat-math-continue-tests: New file.
* modules/unictype/property-id-compat-math-start-tests: New file.
* modules/unictype/property-ids-unary-operator-tests: New file.
* lib/unictype/pr_byname.gperf: Add id_compat_math_start,
id_compat_math_continue, ids_unary_operator.
* lib/unictype/pr_byname.c (UC_PROPERTY_INDEX_ID_COMPAT_MATH_START,
UC_PROPERTY_INDEX_ID_COMPAT_MATH_CONTINUE,
UC_PROPERTY_INDEX_IDS_UNARY_OPERATOR): New enum items.
(uc_property_byname): Handle them.
* modules/unictype/property-byname (Depends-on): Add
unictype/property-id-compat-math-continue,
unictype/property-id-compat-math-start,
unictype/property-ids-unary-operator.
* modules/unictype/property-all (Depends-on): Likewise.
* MODULES.html.sh (func_all_modules): Add
unictype/property-id-compat-math-continue,
unictype/property-id-compat-math-start,
unictype/property-ids-unary-operator.

15 months agoUpdate to Unicode 15.1.0.
Bruno Haible [Tue, 30 Jan 2024 16:08:49 +0000 (17:08 +0100)]
Update to Unicode 15.1.0.

* lib/gen-uni-tables.c (PROP_SENTENCE_TERMINAL): Renamed from
PROP_STERM.
(PROP_IDS_UNARY_OPERATOR, PROP_ID_COMPAT_MATH_CONTINUE,
PROP_ID_COMPAT_MATH_START): New enum items.
(UC_INDIC_CONJUNCT_BREAK_*): New enum items.
(unicode_indic_conjunct_break): New variable.
(fill_properties): Rename local variable propvalue to propcode. Handle
the properties IDS_Unary_Operator, ID_Compat_Math_Continue,
ID_Compat_Math_Start. Parse the InCB values from file
DerivedCoreProperties.txt.
(indic_conjunct_break_as_c_identifier,
output_indic_conjunct_break_test): New functions.
(indic_conjunct_break_table): New variable.
(output_indic_conjunct_break): New function.
(fill_width): Accept spaces at the end of field0 and at the start and
end of field1.
(LBP_QU1, LBP_QU2, LBP_QU3): New enum items, for Unicode TR #14 rules
(LB15a) and (LB15b).
(LBP_AP, LBP_AK, LBP_AS, LBP_VI, LBP_VF): New enum items, for Brahmic
scripts.
(get_lbp): Update such that unilbrk/lbrkprop.txt comes out as expected.
(debug_output_lbp): Print either LBP_QU1 or LBP_QU2 or LBP_QU3 as
LBP_QU. Handle LBP_AP, LBP_AK, LBP_AS, LBP_VI, LBP_VF.
(fill_org_lbp): Accept spaces at the end of field0 and at the start and
end of field1. Recognize LBP_AP, LBP_AK, LBP_AS, LBP_VI, LBP_VF.
(debug_output_org_lbp): Handle LBP_AP, LBP_AK, LBP_AS, LBP_VI, LBP_VF.
(lbp_value_to_string): Handle LBP_QU1, LBP_QU2, LBP_QU3 instead of
LBP_QU. Handle LBP_AP, LBP_AK, LBP_AS, LBP_VI, LBP_VF.
(output_lbrk_rules_as_tables): Treat LBP_QU as macro that maps to three
table rows/columns. Replace rule (LB15) with rules (LB15b) and (LB15a).
(get_wbp): Update such that uniwbrk/wbrkprop.txt comes out as expected.
(main): Invoke output_indic_conjunct_break_test and
output_indic_conjunct_break.

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

* lib/unilbrk/lbrktables.h (LBP_QU1, LBP_QU2, LBP_QU3): New enum items,
for Unicode TR #14 rules (LB15a) and (LB15b).
(LBP_QU): Remove enum item.
(LBP_AP, LBP_AK, LBP_AS, LBP_VI, LBP_VF): New enum items, for Brahmic
scripts.
(unilbrk_table): Update array bounds.
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Conditionally replace LBP_QU2 with LBP_QU1, for rule (LB15a).
Conditionally replace LBP_QU3 with LBP_QU1, for rule (LB15b).
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.

* lib/unictype.in.h (UC_INDIC_CONJUNCT_BREAK_*): New enum values.
(uc_indic_conjunct_break_name, uc_indic_conjunct_break_byname,
uc_indic_conjunct_break): New declarations.
* lib/unictype/incb_byname.c: New file.
* lib/unictype/incb_byname.gperf: New file.
* lib/unictype/incb_name.c: New file.
* lib/unictype/incb_name.h: New file.
* lib/unictype/incb_of.c: New file.
* lib/unictype/incb_of.h: New generated file.
* modules/unictype/incb-all: New file.
* modules/unictype/incb-byname: New file.
* modules/unictype/incb-name: New file.
* modules/unictype/incb-of: New file.
* tests/unictype/test-incb_byname.c: New file.
* tests/unictype/test-incb_name.c: New file.
* tests/unictype/test-incb_of.c: New file.
* tests/unictype/test-incb_of.h: New generated file.
* modules/unictype/incb-byname-tests: New file.
* modules/unictype/incb-name-tests: New file.
* modules/unictype/incb-of-tests: New file.

* lib/unigbrk.in.h (uc_is_grapheme_break, u*_grapheme_next,
u*_grapheme_prev): Add comments.
* lib/unigbrk/u-grapheme-breaks.h (FUNC): Add local variables
incb_consonant_extended, incb_consonant_extended_linker,
incb_consonant_extended_linker_extended. Implement rule (GB9c).
* modules/unigbrk/u8-grapheme-breaks (Depends-on): Add unictype/incb-of.
* 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-uc-is-grapheme-break.c (main): Add local variables
incb_consonant_extended, incb_consonant_extended_linker,
incb_consonant_extended_linker_extended. Skip test cases that match rule
(GB9c).
* modules/unigbrk/uc-is-grapheme-break-tests (Depends-on): Add
unictype/incb-of.

* All the affected modules: Bump required libunistring version.

15 months agounigbrk/uc-is-grapheme-break tests: Reduce verbosity.
Bruno Haible [Tue, 30 Jan 2024 16:37:03 +0000 (17:37 +0100)]
unigbrk/uc-is-grapheme-break tests: Reduce verbosity.

* tests/unigbrk/test-uc-is-grapheme-break.c
(graphemebreakproperty_to_string): Don't print gbp to stdout.

15 months agogen-uni-tables: Update copyright year in output.
Bruno Haible [Tue, 30 Jan 2024 16:07:32 +0000 (17:07 +0100)]
gen-uni-tables: Update copyright year in output.

* 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): Bump copyright year in
output.
* lib/uniname/gen-uninames.lisp (main): Likewise.

15 months agogen-uni-tables: Refactor, based on UAX #14 version 49.
Bruno Haible [Tue, 30 Jan 2024 16:03:05 +0000 (17:03 +0100)]
gen-uni-tables: Refactor, based on UAX #14 version 49.

* lib/gen-uni-tables.c (get_lbp): Reorder, based on
<https://www.unicode.org/reports/tr14/tr14-49.html#DescriptionOfProperties>.
For LBP_EB, use the "emoji modifier base" property.

15 months agounigbrk tests: Tweak error reporting.
Bruno Haible [Tue, 30 Jan 2024 16:00:44 +0000 (17:00 +0100)]
unigbrk tests: Tweak error reporting.

* tests/unigbrk/test-ulc-grapheme-breaks.c (main): Print byte values in
upper-case hexadecimal.
* tests/unigbrk/test-u8-grapheme-breaks.c (test_u8_grapheme_breaks):
Print unit values in upper-case hexadecimal.
* tests/unigbrk/test-u16-grapheme-breaks.c (test_u16_grapheme_breaks):
Print unit values with at least 4 hexadecimal digits.
* tests/unigbrk/test-u32-grapheme-breaks.c (test_u32_grapheme_breaks):
Likewise.
* tests/unigbrk/test-uc-grapheme-breaks.c (test_uc_grapheme_breaks):
Print characters with at least 4 hexadecimal digits.

15 months agoUpdate copyright year in tests/unictype/*.
Bruno Haible [Tue, 30 Jan 2024 15:50:08 +0000 (16:50 +0100)]
Update copyright year in tests/unictype/*.

* tests/unictype/*: Bump copyright years range to include 2024.
* Makefile (update-copyright): Don't exclude the tests/unictype
directory.

15 months agogendocs: get only targetted manual source and includes, when possible
Patrice Dumas [Mon, 29 Jan 2024 17:39:44 +0000 (18:39 +0100)]
gendocs: get only targetted manual source and includes, when possible

* build-aux/gendocs.sh: if makeinfo, based on version, has the
--trace-includes option, gather only the targetted manual srcfile and
the included files obtained with makeinfo --trace-includes. In that
case output include files to tar stdin and use -T-. Bruno Haible for
the version comparison and use of tar.

15 months agoPort FALLTHROUGH to Mac OS X 10.9.
Bruno Haible [Mon, 29 Jan 2024 17:26:41 +0000 (18:26 +0100)]
Port FALLTHROUGH to Mac OS X 10.9.

Report and fix by Ryan Carsten Schmidt <gnulib@ryandesign.com>
at <https://savannah.gnu.org/bugs/?63866>.

* m4/gnulib-common.m4 (gl_COMMON_BODY): For _GL_HAS_ATTRIBUTE, don't use
__has_attribute for Apple clang versions < 7000000.
* lib/cdefs.h (__glibc_has_attribute): Don't use __has_attribute for
Apple clang versions < 7000000.

15 months agolibc-config: Apply lesson learned on 2023-01-13.
Bruno Haible [Mon, 29 Jan 2024 17:17:15 +0000 (18:17 +0100)]
libc-config: Apply lesson learned on 2023-01-13.

* lib/cdefs.h (__glibc_has_attribute): On non-Apple platforms, don't
use __has_attribute for clang versions < 5.0.

15 months agohost-cpu-c-abi: Let gl_HOST_CPU_C_ABI_32BIT never return 'unknown'.
Bruno Haible [Sun, 28 Jan 2024 19:23:10 +0000 (20:23 +0100)]
host-cpu-c-abi: Let gl_HOST_CPU_C_ABI_32BIT never return 'unknown'.

Reported by Mohammad-Reza Nabipoor <mnabipoor@gnu.org>.

* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI_32BIT): Use the list of
always-32-bit CPUs and the list of always-64-bit CPUs also when
gl_HOST_CPU_C_ABI has already been run. As a fallback, use a test of
'sizeof (void *)' to always return 'yes' or 'no', never 'unknown'.

15 months agoFix typo in previous patch
Paul Eggert [Sun, 28 Jan 2024 00:13:50 +0000 (16:13 -0800)]
Fix typo in previous patch

* build-aux/gendocs.sh: Fix quoting typo.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-01/msg00085.html

15 months agogendocs: allow other chars in source file names
Paul Eggert [Sat, 27 Jan 2024 20:44:25 +0000 (12:44 -0800)]
gendocs: allow other chars in source file names

* build-aux/gendocs.sh: Generalize to also allow leading ‘-’
and newlines (!) in source file names.  Exit if there
is an error creating the tarball.

15 months agogendocs: allow spaces, metacharacters and quotes in source file names
Patrice Dumas [Sat, 27 Jan 2024 16:38:07 +0000 (17:38 +0100)]
gendocs: allow spaces, metacharacters and quotes in source file names

* build-aux/gendocs.sh: output files to tar stdin and use -T- to allow
spaces, metacharacters and quotes in file names.  Bruno Haible
solution.

15 months agogendocs: fix --no-html
Patrice Dumas [Sat, 27 Jan 2024 11:55:17 +0000 (12:55 +0100)]
gendocs: fix --no-html

* build-aux/gendocs.sh: fix typo in variable name set by --no-html.

15 months agoexecute tests: Avoid test failure on macOS 14.
Bruno Haible [Fri, 26 Jan 2024 00:12:08 +0000 (01:12 +0100)]
execute tests: Avoid test failure on macOS 14.

Reported by Guangyu Li <gl343@cornell.edu> in
<https://lists.gnu.org/archive/html/bug-gettext/2024-01/msg00006.html>.

* tests/test-execute-main.c (main): In the tests 17, 18, 19, 20, use the
file descriptors 15, 16 instead of 10, 11, respectively.
* tests/test-execute-child.c (main): Likewise.

15 months agoResolve conflicts for functions introduced in Android API level 35.
Bruno Haible [Thu, 25 Jan 2024 23:55:45 +0000 (00:55 +0100)]
Resolve conflicts for functions introduced in Android API level 35.

* lib/time.in.h (timespec_getres): Consider REPLACE_TIMESPEC_GETRES.
* m4/time_h.m4 (gl_TIME_H_DEFAULTS): Initialize REPLACE_TIMESPEC_GETRES.
* modules/time-h (Makefile.am): Substitute REPLACE_TIMESPEC_GETRES.
* m4/timespec_getres.m4 (gl_FUNC_TIMESPEC_GETRES): Test for
timespec_getres using gl_CHECK_FUNCS_ANDROID instead of
AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_TIMESPEC_GETRES.
* modules/timespec_getres (Depends-on, configure.ac): Consider
REPLACE_TIMESPEC_GETRES.
* m4/gettime.m4 (gl_GETTIME_RES): Test for timespec_getres using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* doc/posix-functions/timespec_getres.texi: Mention the Android API
levels.

15 months agoResolve conflicts for functions introduced in Android API level 34.
Bruno Haible [Thu, 25 Jan 2024 23:18:55 +0000 (00:18 +0100)]
Resolve conflicts for functions introduced in Android API level 34.

* m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE): On platforms without
glibc, test for copy_file_range using gl_CHECK_FUNCS_ANDROID instead of
AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_COPY_FILE_RANGE.
* doc/glibc-functions/copy_file_range.texi: Mention the Android API
levels.

15 months agoResolve conflicts for functions introduced in Android API level 34.
Bruno Haible [Thu, 25 Jan 2024 23:18:52 +0000 (00:18 +0100)]
Resolve conflicts for functions introduced in Android API level 34.

* m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): Test for
posix_spawn_file_actions_addchdir_np and
posix_spawn_file_actions_addfchdir_np using gl_CHECK_FUNCS_ANDROID
instead of AC_CHECK_FUNCS_ONCE.
* m4/posix_spawn_faction_addchdir.m4
(gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR): Test for
posix_spawn_file_actions_addchdir_np using gl_CHECK_FUNCS_ANDROID
instead of AC_CHECK_FUNCS_ONCE.
* m4/posix_spawn_faction_addfchdir.m4
(gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR): Test for
posix_spawn_file_actions_addfchdir_np using gl_CHECK_FUNCS_ANDROID
instead of AC_CHECK_FUNCS_ONCE.
* doc/glibc-functions/posix_spawn_file_actions_addchdir_np.texi: Mention
the Android API levels.
* doc/glibc-functions/posix_spawn_file_actions_addfchdir_np.texi:
Likewise.

15 months agoResolve conflicts for functions introduced in Android API level 34.
Bruno Haible [Thu, 25 Jan 2024 23:18:49 +0000 (00:18 +0100)]
Resolve conflicts for functions introduced in Android API level 34.

* lib/string.in.h (memset_explicit): Consider REPLACE_MEMSET_EXPLICIT.
* m4/string_h.m4 (gl_STRING_H_DEFAULTS): Initialize
REPLACE_MEMSET_EXPLICIT.
* modules/string (Makefile.am): Substitute REPLACE_MEMSET_EXPLICIT.
* m4/memset_explicit.m4 (gl_FUNC_MEMSET_EXPLICIT): Test for
memset_explicit using gl_CHECK_FUNCS_ANDROID instead of
AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_MEMSET_EXPLICIT.
* modules/memset_explicit (configure.ac): Consider
REPLACE_MEMSET_EXPLICIT.
* doc/posix-functions/memset_explicit.texi: Mention the Android API
levels.

15 months agoResolve conflicts for functions introduced in Android API level 34.
Bruno Haible [Thu, 25 Jan 2024 23:18:45 +0000 (00:18 +0100)]
Resolve conflicts for functions introduced in Android API level 34.

* m4/freadahead.m4 (gl_FUNC_FREADAHEAD): Test for __freadahead using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* lib/freadahead.h: Update comment.

15 months agoDoc regarding functions introduced in Android API level 33.
Bruno Haible [Thu, 25 Jan 2024 20:04:29 +0000 (21:04 +0100)]
Doc regarding functions introduced in Android API level 33.

* doc/glibc-functions/backtrace.texi: Mention the Android API levels.
* doc/glibc-functions/backtrace_symbols.texi: Likewise.
* doc/glibc-functions/backtrace_symbols_fd.texi: Likewise.
* doc/glibc-functions/preadv2.texi: Likewise.
* doc/glibc-functions/pwritev2.texi: Likewise.

15 months agoResolve conflicts for functions introduced in Android API level 30.
Bruno Haible [Thu, 25 Jan 2024 19:17:33 +0000 (20:17 +0100)]
Resolve conflicts for functions introduced in Android API level 30.

* doc/glibc-functions/memfd_create.texi: Mention the Android API levels.
* doc/glibc-functions/mlock2.texi: Likewise.
* doc/glibc-functions/pthread_cond_clockwait.texi: Likewise.
* doc/glibc-functions/pthread_mutex_clocklock.texi: Likewise.
* doc/glibc-functions/pthread_rwlock_clockrdlock.texi: Likewise.
* doc/glibc-functions/pthread_rwlock_clockwrlock.texi: Likewise.
* doc/glibc-functions/renameat2.texi: Likewise.
* doc/glibc-functions/sem_clockwait.texi: Likewise.
* doc/glibc-functions/statx.texi: Likewise.

15 months agoResolve conflicts for functions introduced in Android API level 30.
Bruno Haible [Thu, 25 Jan 2024 19:15:10 +0000 (20:15 +0100)]
Resolve conflicts for functions introduced in Android API level 30.

* lib/threads.in.h (thrd_sleep): Consider REPLACE_THRD_SLEEP.
(thrd_yield): Consider REPLACE_THRD_YIELD.
(mtx_init): Consider REPLACE_MTX_INIT.
(mtx_lock): Consider REPLACE_MTX_LOCK.
(mtx_trylock): Consider REPLACE_MTX_TRYLOCK.
(mtx_timedlock): Consider REPLACE_MTX_TIMEDLOCK.
(mtx_unlock): Consider REPLACE_MTX_UNLOCK.
(mtx_destroy): Consider REPLACE_MTX_DESTROY.
(call_once): Consider REPLACE_CALL_ONCE. Fix warning message.
(cnd_init): Consider REPLACE_CND_INIT.
(cnd_wait): Consider REPLACE_CND_WAIT.
(cnd_timedwait): Consider REPLACE_CND_TIMEDWAIT.
(cnd_signal): Consider REPLACE_CND_SIGNAL.
(cnd_broadcast): Consider REPLACE_CND_BROADCAST.
(cnd_destroy): Consider REPLACE_CND_DESTROY.
(tss_create): Consider REPLACE_TSS_CREATE.
(tss_set): Consider REPLACE_TSS_SET.
(tss_get): Consider REPLACE_TSS_GET.
(tss_delete): Consider REPLACE_TSS_DELETE.
* m4/threads_h.m4 (gl_THREADS_H_DEFAULTS): Initialize REPLACE_CALL_ONCE,
REPLACE_CND_BROADCAST, REPLACE_CND_DESTROY, REPLACE_CND_INIT,
REPLACE_CND_SIGNAL, REPLACE_CND_TIMEDWAIT, REPLACE_CND_WAIT,
REPLACE_MTX_DESTROY, REPLACE_MTX_INIT, REPLACE_MTX_LOCK,
REPLACE_MTX_TIMEDLOCK, REPLACE_MTX_TRYLOCK, REPLACE_MTX_UNLOCK,
REPLACE_THRD_SLEEP, REPLACE_THRD_YIELD, REPLACE_TSS_CREATE,
REPLACE_TSS_DELETE, REPLACE_TSS_GET, REPLACE_TSS_SET.
* modules/threads-h (Makefile.am): Substitute REPLACE_CALL_ONCE,
REPLACE_CND_BROADCAST, REPLACE_CND_DESTROY, REPLACE_CND_INIT,
REPLACE_CND_SIGNAL, REPLACE_CND_TIMEDWAIT, REPLACE_CND_WAIT,
REPLACE_MTX_DESTROY, REPLACE_MTX_INIT, REPLACE_MTX_LOCK,
REPLACE_MTX_TIMEDLOCK, REPLACE_MTX_TRYLOCK, REPLACE_MTX_UNLOCK,
REPLACE_THRD_SLEEP, REPLACE_THRD_YIELD, REPLACE_TSS_CREATE,
REPLACE_TSS_DELETE, REPLACE_TSS_GET, REPLACE_TSS_SET.
* m4/thrd.m4 (gl_FUNC_THRD_CREATE): New macro.
* modules/thrd (configure.ac): Invoke gl_FUNC_THRD_CREATE.
* m4/call_once.m4: New file.
* modules/call_once (Files): Add m4/call_once.m4.
(configure.ac): Invoke gl_FUNC_CALL_ONCE. Consider REPLACE_CALL_ONCE.
* m4/cnd.m4: New file.
* modules/cnd (Files): Add m4/cnd.m4.
(configure.ac): Invoke gl_FUNC_CND_INIT. Consider REPLACE_CND_INIT.
* m4/mtx.m4: New file.
* modules/mtx (Files): Add m4/mtx.m4.
(configure.ac): Invoke gl_FUNC_MTX_INIT. Consider REPLACE_MTX_INIT.
* m4/tss.m4: New file.
* modules/tss (Files): Add m4/tss.m4.
(configure.ac): Invoke gl_FUNC_TSS_CREATE. Consider REPLACE_TSS_CREATE.
* doc/posix-functions/call_once.texi: Mention the Android API levels.
* doc/posix-functions/cnd_broadcast.texi: Likewise.
* doc/posix-functions/cnd_destroy.texi: Likewise.
* doc/posix-functions/cnd_init.texi: Likewise.
* doc/posix-functions/cnd_signal.texi: Likewise.
* doc/posix-functions/cnd_timedwait.texi: Likewise.
* doc/posix-functions/cnd_wait.texi: Likewise.
* doc/posix-functions/mtx_destroy.texi: Likewise.
* doc/posix-functions/mtx_init.texi: Likewise.
* doc/posix-functions/mtx_lock.texi: Likewise.
* doc/posix-functions/mtx_timedlock.texi: Likewise.
* doc/posix-functions/mtx_trylock.texi: Likewise.
* doc/posix-functions/mtx_unlock.texi: Likewise.
* doc/posix-functions/thrd_create.texi: Likewise.
* doc/posix-functions/thrd_current.texi: Likewise.
* doc/posix-functions/thrd_detach.texi: Likewise.
* doc/posix-functions/thrd_equal.texi: Likewise.
* doc/posix-functions/thrd_exit.texi: Likewise.
* doc/posix-functions/thrd_join.texi: Likewise.
* doc/posix-functions/thrd_sleep.texi: Likewise.
* doc/posix-functions/thrd_yield.texi: Likewise.
* doc/posix-functions/tss_create.texi: Likewise.
* doc/posix-functions/tss_delete.texi: Likewise.
* doc/posix-functions/tss_get.texi: Likewise.
* doc/posix-functions/tss_set.texi: Likewise.

15 months agoreadutmp, boot-time: Port to Android NDK r26.
Bruno Haible [Sun, 21 Jan 2024 16:50:52 +0000 (17:50 +0100)]
readutmp, boot-time: Port to Android NDK r26.

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

* lib/readutmp.h: Update comments.
(UTMP_NAME_FUNCTION): Define as a no-op for Android with HAVE_UTMPX_H.

15 months agoasyncsafe-spin: Fix link error on various platforms.
Bruno Haible [Sun, 21 Jan 2024 14:59:32 +0000 (15:59 +0100)]
asyncsafe-spin: Fix link error on various platforms.

* m4/atomic-cas.m4: New file.
* lib/asyncsafe-spin.c: Test HAVE_ATOMIC_COMPARE_AND_SWAP_GCC41 instead
of a condition that considers only __sparc__, __ANDROID__, __ibmxl__.
* lib/pthread-spin.c: Likewise.
* lib/simple-atomic.c: Likewise.
* modules/asyncsafe-spin (Files): Add m4/atomic-cas.m4.
(configure.ac): Require gl_ATOMIC_COMPARE_AND_SWAP.
* modules/pthread-spin: Likewise.
* modules/simple-atomic: Likewise.

15 months agofenv-environment: Fix for NetBSD/powerpc.
Bruno Haible [Fri, 19 Jan 2024 21:58:43 +0000 (22:58 +0100)]
fenv-environment: Fix for NetBSD/powerpc.

* m4/fenv-environment.m4 (gl_FENV_ENVIRONMENT): For feupdateenv, use
the same configure test on NetBSD/powerpc as on glibc/hppa.
* doc/posix-functions/feupdateenv.texi: Mention the NetBSD/powerpc bug.

15 months agofenv-exceptions-trapping: Avoid a test failure on *BSD/powerpc*.
Bruno Haible [Fri, 19 Jan 2024 21:43:55 +0000 (22:43 +0100)]
fenv-exceptions-trapping: Avoid a test failure on *BSD/powerpc*.

* tests/test-fenv-except-trapping-2.c (main): Skip the '4' tests also on
FreeBSD/powerpc* and NetBSD/powerpc*.

15 months agofenv-exceptions-state-c99: Fix for FreeBSD/powerpc64 and NetBSD/powerpc.
Bruno Haible [Fri, 19 Jan 2024 21:34:27 +0000 (22:34 +0100)]
fenv-exceptions-state-c99: Fix for FreeBSD/powerpc64 and NetBSD/powerpc.

* m4/fenv-exceptions-state.m4 (gl_FENV_EXCEPTIONS_STATE): On
FreeBSD/powerpc64 and NetBSD/powerpc, set REPLACE_FESETEXCEPTFLAG.
* doc/posix-functions/fesetexceptflag.texi: Mention the FreeBSD and
NetBSD bug.

15 months agofenv-*: Avoid test failures on FreeBSD/powerpc64 and NetBSD/powerpc.
Bruno Haible [Fri, 19 Jan 2024 21:04:33 +0000 (22:04 +0100)]
fenv-*: Avoid test failures on FreeBSD/powerpc64 and NetBSD/powerpc.

On these platforms, FE_ALL_EXCEPT contains additional bits.

* tests/test-fenv-except-tracking-1.c (FE_VXSOFT, FE_VXZDZ): Define
fallbacks.
(main): Allow fetestexcept(FE_ALL_EXCEPT) to contain FE_VXSOFT or
FE_VXZDZ in addition to FE_INVALID.
* tests/test-fenv-except-tracking-4.c (FE_VXSOFT): Define fallback.
(main): Allow fetestexcept(FE_ALL_EXCEPT) to contain FE_VXSOFT in
addition to FE_INVALID.
* tests/test-fenv-env-2.c: Likewise.
* tests/test-fenv-env-3.c: Likewise.
* tests/test-fenv-env-4.c: Likewise.
* tests/test-fenv-env-5.c: Likewise.

15 months agofenv-*: Fix test failures on NetBSD 9.3/arm64.
Bruno Haible [Fri, 19 Jan 2024 14:07:05 +0000 (15:07 +0100)]
fenv-*: Fix test failures on NetBSD 9.3/arm64.

* m4/fenv-exceptions-trapping.m4 (gl_FENV_EXCEPTIONS_TRAPPING): Override
feenableexcept() also on NetBSD/arm64.
* doc/glibc-functions/feenableexcept.texi: Update platforms list.

15 months agofenv-*: Avoid test failures on OpenBSD/sparc64.
Bruno Haible [Fri, 19 Jan 2024 09:55:13 +0000 (10:55 +0100)]
fenv-*: Avoid test failures on OpenBSD/sparc64.

* tests/test-fenv-except-tracking-2.c (main): On OpenBSD/sparc64, skip
the 'long double' test.
* tests/test-fenv-except-trapping-2.c (main): Skip the 'long double'
tests also on OpenBSD/sparc64.

15 months agofenv-rounding: Avoid a test failure on OpenBSD/arm64.
Bruno Haible [Thu, 18 Jan 2024 23:54:13 +0000 (00:54 +0100)]
fenv-rounding: Avoid a test failure on OpenBSD/arm64.

* tests/test-fenv-round.c (test_towardzero, test_upward, test_downward):
Skip the 'long double' tests on OpenBSD/arm64.
* doc/posix-functions/fesetround.texi: Update platforms list.

15 months agoAvoid test failures in FreeBSD's GB18030 locale.
Bruno Haible [Thu, 18 Jan 2024 21:17:07 +0000 (22:17 +0100)]
Avoid test failures in FreeBSD's GB18030 locale.

The FreeBSD 14.0 iconv converter (GB18030 → UTF-8) cannot convert e.g.
0x94 0x32 0xBB 0x34 to U+1D100.

* tests/test-c32isalnum.c (main): Skip the GB18030 locale tests on
FreeBSD, if GL_CHAR32_T_IS_UNICODE (or, equivalently,
GL_CHAR32_T_VS_WCHAR_T_NEEDS_CONVERSION) is defined.
* tests/test-c32isalpha.c (main): Likewise.
* tests/test-c32isblank.c (main): Likewise.
* tests/test-c32iscntrl.c (main): Likewise.
* tests/test-c32isdigit.c (main): Likewise.
* tests/test-c32islower.c (main): Likewise.
* tests/test-c32ispunct.c (main): Likewise.
* tests/test-c32isspace.c (main): Likewise.
* tests/test-c32isupper.c (main): Likewise.
* tests/test-c32isxdigit.c (main): Likewise.
* tests/test-c32rtomb.c (main): Likewise.
* tests/test-c32snrtombs.c (main): Likewise.
* tests/test-c32srtombs.c (main): Likewise.
* tests/test-c32stombs.c (main): Likewise.
* tests/test-c32tolower.c (main): Likewise.
* tests/test-c32toupper.c (main): Likewise.
* tests/test-mbrtoc16.c (main): Likewise.
* tests/test-mbrtoc32.c (main): Likewise.
* tests/test-mbsnrtoc32s.c (main): Likewise.
* tests/test-mbsrtoc32s.c (main): Likewise.
* tests/test-mbstoc32s.c (main): Likewise.

15 months agoget-rusage-data: Avoid test failure on NetBSD 9.3.
Bruno Haible [Thu, 18 Jan 2024 18:59:34 +0000 (19:59 +0100)]
get-rusage-data: Avoid test failure on NetBSD 9.3.

* tests/test-get-rusage-data.c (main): Don't expect a strict increase on
NetBSD systems.

15 months agolog10l: Work around bug on NetBSD 9.3/arm64.
Bruno Haible [Thu, 18 Jan 2024 18:46:53 +0000 (19:46 +0100)]
log10l: Work around bug on NetBSD 9.3/arm64.

* m4/log10l.m4 (gl_FUNC_LOG10L_WORKS): Add another test case, taken from
the unit test.

15 months agodoc: Update regarding <math.h> *l functions on NetBSD 9.3.
Bruno Haible [Thu, 18 Jan 2024 15:29:21 +0000 (16:29 +0100)]
doc: Update regarding <math.h> *l functions on NetBSD 9.3.

* doc/posix-functions/acoshl.texi: Mention the buggy implementation on
NetBSD.
* doc/posix-functions/acosl.texi: Likewise.
* doc/posix-functions/asinhl.texi: Likewise.
* doc/posix-functions/asinl.texi: Likewise.
* doc/posix-functions/atan2l.texi: Likewise.
* doc/posix-functions/atanhl.texi: Likewise.
* doc/posix-functions/atanl.texi: Likewise.
* doc/posix-functions/coshl.texi: Likewise.
* doc/posix-functions/cosl.texi: Likewise.
* doc/posix-functions/erfcl.texi: Likewise.
* doc/posix-functions/erfl.texi: Likewise.
* doc/posix-functions/powl.texi: Likewise.
* doc/posix-functions/sinhl.texi: Likewise.
* doc/posix-functions/sinl.texi: Likewise.
* doc/posix-functions/tanhl.texi: Likewise.
* doc/posix-functions/tanl.texi: Likewise.
* doc/posix-functions/expl.texi: Update NetBSD version info.
* doc/posix-functions/exp2l.texi: Likewise.
* doc/posix-functions/hypotl.texi: Likewise.
* doc/posix-functions/logl.texi: Likewise.
* doc/posix-functions/log10l.texi: Likewise.
* m4/expl.m4 (gl_FUNC_EXPL): Update comments.
* m4/exp2l.m4 (gl_FUNC_EXP2L): Likewise.
* m4/hypotl.m4 (gl_FUNC_HYPOTL_WORKS): Likewise.
* m4/logl.m4 (gl_FUNC_LOGL_WORKS): Likewise.
* m4/log10l.m4 (gl_FUNC_LOG10L_WORKS): Likewise.

15 months agomodfl: Work around bug on NetBSD 9.3/arm64.
Bruno Haible [Thu, 18 Jan 2024 14:41:39 +0000 (15:41 +0100)]
modfl: Work around bug on NetBSD 9.3/arm64.

* m4/modfl.m4 (gl_FUNC_MODFL): Add test whether modfl basically works.
* doc/posix-functions/modfl.texi: Mention the NetBSD bug.

15 months agoisnanl: Avoid autoconf warning.
Bruno Haible [Thu, 18 Jan 2024 14:15:43 +0000 (15:15 +0100)]
isnanl: Avoid autoconf warning.

* m4/isnanl.m4 (gl_FUNC_ISNANL): Declare through AC_DEFUN_ONCE.

15 months agofmaf, fma, fmal: Work around bugs on OpenBSD 7.4/arm64.
Bruno Haible [Thu, 18 Jan 2024 13:55:25 +0000 (14:55 +0100)]
fmaf, fma, fmal: Work around bugs on OpenBSD 7.4/arm64.

* m4/fmaf.m4 (gl_FUNC_FMAF_WORKS): Use a volatile function pointer
variable to disable clang's inlining.
* m4/fma.m4 (gl_FUNC_FMA_WORKS): Likewise.
* m4/fmal.m4 (gl_FUNC_FMAL_WORKS): Likewise.
* doc/posix-functions/fmaf.texi: Mention the OpenBSD bug.
* doc/posix-functions/fma.texi: Likewise.
* doc/posix-functions/fmal.texi: Likewise.

15 months agodoc: Update regarding stable branches.
Bruno Haible [Thu, 18 Jan 2024 08:56:44 +0000 (09:56 +0100)]
doc: Update regarding stable branches.

* doc/gnulib-readme.texi (Stable Branches): Mention new branch
stable-202401. Mention that stable-202301 is no longer updated.

15 months agogetopt-gnu: Fix out-of-bounds access (regression 2023-12-11).
Bruno Haible [Thu, 18 Jan 2024 00:12:20 +0000 (01:12 +0100)]
getopt-gnu: Fix out-of-bounds access (regression 2023-12-11).

* lib/getopt.c (process_long_option): Don't set ambig_set[option_index]
if ambig_set is &ambig_fallback.

15 months agoImprove naming of local variables.
Bruno Haible [Wed, 17 Jan 2024 20:53:15 +0000 (21:53 +0100)]
Improve naming of local variables.

* gnulib-tool, posix-modules, build-aux/relocatable.sh.in,
build-aux/reloc-ldflags, build-aux/install-reloc, tests/init.sh,
m4/argz.m4: Rename save_IFS to saved_IFS.
* m4/*.m4: Rename save_LIBS to saved_LIBS.
* m4/00gnulib.m4, m4/gnulib-common.m4, m4/warn-on-use.m4, m4/wchar_h.m4:
Rename save_ac_compile to saved_ac_compile.
* m4/00gnulib.m4: Rename ac_save_ac_compile to ac_saved_ac_compile.
* m4/gnulib-common.m4: Rename save_ac_compile_for_check_decl to
saved_ac_compile_for_check_decl.
* m4/assert_h.m4, m4/manywarnings.m4, m4/stdalign.m4, m4/visibility.m4:
Rename gl_save_CFLAGS to gl_saved_CFLAGS.
* m4/dirfd.m4: Rename dirfd_save_CFLAGS to gl_saved_CFLAGS.
* m4/include_next.m4, m4/pread.m4, m4/pwrite.m4, m4/termcap.m4,
m4/terminfo.m4: Rename gl_save_CPPFLAGS to gl_saved_CPPFLAGS.
* m4/lib-link.m4: Rename ac_save_CPPFLAGS to acl_save_CPPFLAGS.
* m4/iconv.m4, m4/readline.m4: Rename am_save_CPPFLAGS to
gl_saved_CPPFLAGS.
* m4/gettext.m4: Rename gt_save_CPPFLAGS to gt_saved_CPPFLAGS.
* m4/ansi-c++.m4: Rename gl_save_CXX to gl_saved_CXX.
* m4/manywarnings-c++.m4: Rename gl_save_CXXFLAGS to gl_saved_CXXFLAGS.
* m4/lib-link.m4: Rename acl_save_ifs to acl_saved_IFS.
* m4/lib-prefix.m4: Rename acl_save_IFS to acl_saved_IFS.
* m4/progtest.m4: Rename ac_save_IFS to gt_saved_IFS.
* m4/lib-link.m4: Rename save_libdir to saved_libdir, acl_save_libdir to
acl_saved_libdir.
* m4/ld-version-script.m4: Rename save_LDFLAGS to saved_LDFLAGS.
* m4/acl.m4, m4/getgroups.m4: Rename ac_save_LIBS to gl_saved_LIBS.
* m4/lib-link.m4: Rename ac_save_LIBS to acl_saved_LIBS.
* m4/getdomainname.m4, m4/gethostname.m4, m4/getloadavg.m4,
m4/hostent.m4, m4/inet_ntop.m4, m4/inet_pton.m4,
m4/pthread_mutex_timedlock.m4, m4/pthread_sigmask.m4,
m4/pthread-spin.m4, m4/readutmp.m4, m4/selinux-selinux-h.m4,
m4/servent.m4, m4/socketlib.m4, m4/termcap.m4, m4/terminfo.m4,
m4/thread.m4: Rename gl_save_LIBS to gl_saved_LIBS.
* m4/getaddrinfo.m4, m4/iconv.m4, m4/readline.m4: Rename am_save_LIBS to
gl_saved_LIBS.
* m4/gettext.m4, m4/intlmacosx.m4: Rename gt_save_LIBS to gt_saved_LIBS.
* m4/libunistring.m4: Rename glus_save_LIBS to glus_saved_LIBS.
* m4/nanosleep.m4: Rename nanosleep_save_libs to gl_saved_LIBS.
* m4/lib-prefix.m4: Rename acl_save_prefix to acl_saved_prefix,
acl_save_exec_prefix to acl_saved_exec_prefix.
* m4/configmake.m4: Rename gl_save_<variable> to gl_saved_<variable>.
* m4/terminfo.m4: Likewise.
* m4/gettext.m4: Rename gt_save_<variable> to gt_saved_<variable>.
* m4/javaexec.m4: Rename save_CLASSPATH to gt_saved_CLASSPATH.
* m4/warnings.m4: Rename gl_save_compiler_FLAGS to
gl_saved_compiler_FLAGS.
* lib/pread.c, lib/pwrite.c, lib/read-file.c, lib/tempname.c: Rename
save_errno to saved_errno.
* lib/read-file.c: Rename save_alloc to saved_alloc.
* lib/strptime.c: Rename save_wday to saved_wday, save_mday to
saved_mday, save_mon to saved_mon.

15 months agoposixtm: pacify clang 18
Paul Eggert [Wed, 17 Jan 2024 01:21:08 +0000 (17:21 -0800)]
posixtm: pacify clang 18

Problem reported by Khem Raj in:
https://lists.gnu.org/r/bug-gnulib/2024-01/msg00045.html
* lib/posixtm.c (posixtime): Pacify clang 18 by converting bool to int.
Arguably this is a bug in draft C2x, since the non-pointer args to
ckd_add should promote just like any other expressions do;
but that’s not clang’s fault.

15 months agoupdate-copyright: handle more cases
Jim Meyering [Mon, 15 Jan 2024 18:36:34 +0000 (10:36 -0800)]
update-copyright: handle more cases

* build-aux/update-copyright: Handle cases like gunzip.in
with its two copyright lines.
Making it work required two changes: don't stop upon first match.
And then, when continuing, a little trickiness: knowing that the
final substitution would reset m{}g's "pos()", so save and restore
that, to avoid an infinite loop in some cases.
* tests/test-update-copyright.sh: Add a test for this.

15 months agotest-framework-sh: fix spelling typo
Paul Eggert [Mon, 15 Jan 2024 16:36:51 +0000 (08:36 -0800)]
test-framework-sh: fix spelling typo

* tests/init.sh (setup_): Name local var consistently with
elsewhere in Gnulib, fixing a typo.

15 months agoautoupdate
Karl Berry [Mon, 15 Jan 2024 15:11:14 +0000 (07:11 -0800)]
autoupdate