]> Savannah Git Hosting - gnulib.git/log
gnulib.git
2 months agonewlocale, freelocale: Tweak configuration.
Bruno Haible [Fri, 14 Feb 2025 13:32:30 +0000 (14:32 +0100)]
newlocale, freelocale: Tweak configuration.

* m4/newlocale.m4 (gl_FUNC_NEWLOCALE): Make consistent with
m4/localename.m4.
* m4/freelocale.m4 (gl_FUNC_FREELOCALE): Likewise.

2 months agoduplocale: Support all platforms.
Bruno Haible [Fri, 14 Feb 2025 04:56:55 +0000 (05:56 +0100)]
duplocale: Support all platforms.

* lib/locale.in.h (duplocale): Declare also on platforms that don't
already have a duplocale function. Don't define HAVE_WORKING_DUPLOCALE.
* lib/duplocale.c: Include <stdlib.h>.
(duplocale): Renamed from rpl_duplocale. Add implementation for
platforms without native locale_t.
* modules/duplocale (Depends-on): Add newlocale, freelocale.
(configure.ac): Compile also on platforms without native locale_t.
* tests/test-duplocale.c: Ignore HAVE_WORKING_DUPLOCALE.
* tests/test-locale-h-c++.cc: Likewise.
* doc/posix-functions/duplocale.texi: Mention the change.

2 months agofreelocale: Fix typo.
Bruno Haible [Fri, 14 Feb 2025 04:55:48 +0000 (05:55 +0100)]
freelocale: Fix typo.

* lib/locale.in.h (freelocale): Fix mistake in last patch.

2 months agofreelocale: Add tests.
Bruno Haible [Fri, 14 Feb 2025 02:06:56 +0000 (03:06 +0100)]
freelocale: Add tests.

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

2 months agofreelocale: New module.
Bruno Haible [Fri, 14 Feb 2025 01:59:02 +0000 (02:59 +0100)]
freelocale: New module.

* lib/locale.in.h (freelocale): Consider GNULIB_FREELOCALE. Declare if
not declared.
* lib/freelocale.c: New file.
* m4/freelocale.m4: New file.
* m4/locale_h.m4 (gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_FREELOCALE.
* modules/locale-h (Makefile.am): Substitute GNULIB_FREELOCALE.
* modules/freelocale: New file.
* tests/test-locale-h-c++.cc: Check declaration of freelocale.
* doc/posix-functions/freelocale.texi: Mention the new module.

2 months agonewlocale: Add tests.
Bruno Haible [Fri, 14 Feb 2025 01:52:01 +0000 (02:52 +0100)]
newlocale: Add tests.

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

2 months agonewlocale: New module.
Bruno Haible [Thu, 13 Feb 2025 22:01:52 +0000 (23:01 +0100)]
newlocale: New module.

* lib/locale.in.h (newlocale): Consider GNULIB_NEWLOCALE. Declare if
not declared. Don't define HAVE_WORKING_NEWLOCALE.
* lib/newlocale.c: New file.
* m4/newlocale.m4: New file.
* m4/locale_h.m4 (gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize
GNULIB_NEWLOCALE.
* modules/locale-h (Makefile.am): Substitute GNULIB_NEWLOCALE.
* modules/newlocale: New file.
* tests/test-locale-h-c++.cc: Check declaration of newlocale.
* tests/test-localename.c: Ignore HAVE_WORKING_NEWLOCALE.
* doc/posix-functions/newlocale.texi: Mention the new module.

2 months agolocalename-environ: New module.
Bruno Haible [Fri, 14 Feb 2025 01:02:58 +0000 (02:02 +0100)]
localename-environ: New module.

* lib/localename-environ.c: New file, extracted from
lib/localename-unsafe.c.
* lib/localename-unsafe.c (gl_locale_name_environ): Remove function.
* m4/localename.m4 (gl_LOCALENAME_ENVIRON): New macro.
* modules/localename-environ: New file.
* modules/localename-unsafe (Depends-on): Add localename-environ.
* modules/setlocale (Depends-on): Likewise.

2 months agolocale-h: Ensure locale_t type.
Bruno Haible [Thu, 13 Feb 2025 21:16:13 +0000 (22:16 +0100)]
locale-h: Ensure locale_t type.

* lib/locale.in.h (gl_log2_lc_mask, gl_log2_lcmask_to_index,
gl_index_to_log2_lcmask): New macros.
(LC_COLLATE_MASK, LC_CTYPE_MASK, LC_MESSAGES_MASK, LC_MONETARY_MASK,
LC_NUMERIC_MASK, LC_TIME_MASK, LC_ALL_MASK): New macros.
(struct gl_locale_category_t, struct gl_locale_t, locale_t): New types.
(LC_GLOBAL_LOCALE, GNULIB_defined_locale_t): New macros.
* m4/locale_h.m4 (gl_LOCALE_H): Set and define HAVE_WINDOWS_LOCALE_T.
(gl_LOCALE_T): Prepare for substituting HAVE_LOCALE_T.
* modules/locale-h (Depends-on): Add bool.
(Makefile.am): Substitute HAVE_LOCALE_T, HAVE_WINDOWS_LOCALE_T.
* tests/test-locale-h.c: Check that the LC_*_MASK macros and locale_t
are defined.
* doc/posix-headers/locale.texi: Document the change.

2 months agoduplocale: Relicense under LGPLv2+.
Bruno Haible [Thu, 13 Feb 2025 20:46:12 +0000 (21:46 +0100)]
duplocale: Relicense under LGPLv2+.

* modules/duplocale (License): Change to LGPLv2+.
* lib/duplocale.c: Update license notice.

2 months agoRename module ctype to ctype-h.
Bruno Haible [Thu, 13 Feb 2025 20:00:06 +0000 (21:00 +0100)]
Rename module ctype to ctype-h.

* modules/ctype-h: Renamed from modules/ctype.
* modules/ctype-h-tests: Renamed from modules/ctype-tests.
* modules/ctype-h-c++-tests: Renamed from modules/ctype-c++-tests.
* tests/test-ctype-h.c: Renamed from tests/test-ctype.c.
* tests/test-ctype-h-c++.cc: Renamed from tests/test-ctype-c++.cc.
* tests/test-ctype-h-c++2.cc: Renamed from tests/test-ctype-c++2.cc.
* doc/posix-headers/ctype.texi: Update.
* modules/* (Depends-on): Update.
* modules/ctype: New file.

2 months agogetaddrinfo: Fix a compilation error in C++ mode (regression yesterday).
Bruno Haible [Thu, 13 Feb 2025 11:02:16 +0000 (12:02 +0100)]
getaddrinfo: Fix a compilation error in C++ mode (regression yesterday).

Reported by KO Myung-Hun <komh78@gmail.com>.

* m4/getaddrinfo.m4 (gl_GETADDRINFO): Don't set REPLACE_GETADDRINFO to 1
if getaddrinfo does not exist.

2 months agosetlocale: Update info about Galician and Tamil.
Bruno Haible [Thu, 13 Feb 2025 01:18:05 +0000 (02:18 +0100)]
setlocale: Update info about Galician and Tamil.

* lib/setlocale.c (locales_with_principal_territory): Galician is
mostly spoken in Spain, not Portugal. Tamil is mostly spoken in India,
not Sri Lanka.

2 months agogettext-h: Fix compilation error on native Windows.
Bruno Haible [Wed, 12 Feb 2025 22:43:21 +0000 (23:43 +0100)]
gettext-h: Fix compilation error on native Windows.

* modules/gettext-h (Depends-on): Add locale-h.

2 months agogetaddrinfo: Support the AI_NUMERICSERV flag.
Bruno Haible [Wed, 12 Feb 2025 22:34:39 +0000 (23:34 +0100)]
getaddrinfo: Support the AI_NUMERICSERV flag.

* m4/getaddrinfo.m4 (gl_GETADDRINFO): Require AC_CANONICAL_HOST. Test
whether getaddrinfo supports AI_NUMERICSERV.
* lib/getaddrinfo.c (getaddrinfo): Accept and implement the
AI_NUMERICSERV flag.
* tests/test-getaddrinfo.c (simple): In pass 4, pass the AI_NUMERICSERV
flag.
(main): Test numeric services in pass 1. Add pass 4.
* doc/posix-functions/getaddrinfo.texi: Mention the native Windows bug.

2 months agogetaddrinfo: Support the AI_NUMERICHOST flag.
Bruno Haible [Wed, 12 Feb 2025 19:03:29 +0000 (20:03 +0100)]
getaddrinfo: Support the AI_NUMERICHOST flag.

* lib/getaddrinfo.c (is_numeric_host): New function.
(getaddrinfo): Accept and implement the AI_NUMERICHOST flag.
* modules/getaddrinfo (Depends-on): Add inet_pton.
* tests/test-getaddrinfo.c: Include <ctype.h>.
(simple): In pass 3, pass the AI_NUMERICHOST flag.
(main): Add a pass 3.

2 months agogetaddrinfo tests: Test both a NULL and a non-NULL hints argument.
Bruno Haible [Wed, 12 Feb 2025 18:05:20 +0000 (19:05 +0100)]
getaddrinfo tests: Test both a NULL and a non-NULL hints argument.

* tests/test-getaddrinfo.c (simple): Add a 'pass' argument.
(main): Make two passes of 'simple' invocations.

2 months agonetdb-h: Ensure AI_NUMERICHOST and AI_NUMERICSERV are defined.
Bruno Haible [Wed, 12 Feb 2025 17:43:59 +0000 (18:43 +0100)]
netdb-h: Ensure AI_NUMERICHOST and AI_NUMERICSERV are defined.

* lib/netdb.in.h (AI_NUMERICHOST): New macro.
* tests/test-netdb-h.c: Verify that AI_NUMERICHOST and AI_NUMERICSERV
are defined.
* doc/posix-headers/netdb.texi: Mention the platform support for
AI_NUMERICHOST and AI_NUMERICSERV.

2 months agoacl-permissions, file-has-acl: Depend on stdint-h for SIZE_MAX.
Collin Funk [Wed, 12 Feb 2025 02:44:33 +0000 (18:44 -0800)]
acl-permissions, file-has-acl: Depend on stdint-h for SIZE_MAX.

* lib/acl-internal.h: Include stdint.h.
(SIZE_MAX): Remove definition.
* lib/file-has-acl.c: Don't include stdint.h again.
* modules/acl-permissions (Depends-on): Add stdint-h.
* modules/file-has-acl (Depends-on): Likewise.

2 months agopopen: Set gl_cv_func_popen_works to "guessing no" on OS/2.
KO Myung-Hun [Mon, 10 Feb 2025 11:35:00 +0000 (20:35 +0900)]
popen: Set gl_cv_func_popen_works to "guessing no" on OS/2.

* doc/posix-functions/popen.texi: List OS/2 kLIBC case.
* m4/popen.m4 (gl_FUNC_POPEN): Set gl_cv_func_popen_works to
"guessing no" on OS/2.

Copyright-paperwork-exempt: Yes

2 months agombsstr, unistr, unigbrk: Support library namespacing.
Bruno Haible [Mon, 10 Feb 2025 15:22:19 +0000 (16:22 +0100)]
mbsstr, unistr, unigbrk: Support library namespacing.

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Don't define
const-improved macro if the function is already declared as a macro.
* lib/unistr.in.h (u*_check, u*_next, u*_prev, u*_chr, u*_strchr,
u*_strrchr, u*_strpbrk, u*_strstr): Likewise.
* lib/unigbrk.in.h (u*_grapheme_next, u*_grapheme_prev): Likewise.

2 months agombsstr, etc.: Fix compilation in C++ mode on AIX with xlc.
Bruno Haible [Mon, 10 Feb 2025 10:46:01 +0000 (11:46 +0100)]
mbsstr, etc.: Fix compilation in C++ mode on AIX with xlc.

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Wrap template
declarations and definitions in 'extern "C++" { ... }'.

2 months agombsstr, unistr, unigbrk: Fix compilation with "gcc-4.8.5 -std=gnu11".
Bruno Haible [Mon, 10 Feb 2025 07:25:19 +0000 (08:25 +0100)]
mbsstr, unistr, unigbrk: Fix compilation with "gcc-4.8.5 -std=gnu11".

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Don't assume that
GCC and clang support '_Generic' with '-std=c11' or 'std=gnu11' option.
* lib/unistr.in.h (u*_check, u*_next, u*_prev, u*_chr, u*_strchr,
u*_strrchr, u*_strpbrk, u*_strstr): Likewise.
* lib/unigbrk.in.h (u*_grapheme_next, u*_grapheme_prev): Likewise.

2 months agostring-buffer, string-buffer-reversed: Allow for better static analysis.
Bruno Haible [Sun, 9 Feb 2025 21:02:27 +0000 (22:02 +0100)]
string-buffer, string-buffer-reversed: Allow for better static analysis.

* lib/string-buffer.h (sb_appendvf, sb_appendf, sb_xappendvf,
sb_xappendf): Don't declare if SB_NO_APPENDF is defined.
(sb_xdupfree_c): Declare a non-NULL return value if SB_NO_APPENDF is
defined.
* lib/string-buffer-reversed.h (sbr_prependvf, sbr_prependf,
sbr_xprependvf, sbr_xprependf): Don't declare if SBR_NO_PREPENDF is
defined.
(sbr_xdupfree_c): Declare a non-NULL return value if SBR_NO_PREPENDF is
defined.

2 months agoxstring-desc: Allow for better static analysis.
Bruno Haible [Sun, 9 Feb 2025 21:02:14 +0000 (22:02 +0100)]
xstring-desc: Allow for better static analysis.

* lib/xstring-desc.h (xsd_c): Declare a non-NULL return value.

2 months agombsstr, mbscasestr, mbspcasecmp, unistr, unigbrk: Simplify.
Bruno Haible [Sun, 9 Feb 2025 20:40:08 +0000 (21:40 +0100)]
mbsstr, mbscasestr, mbspcasecmp, unistr, unigbrk: Simplify.

Suggested by Paul Eggert.

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): On ISO C compliant
compilers, use the _Generic based macro instead of the 'typeof' based
macro.
* lib/unistr.in.h (u*_check, u*_next, u*_prev, u*_chr, u*_strchr,
u*_strrchr, u*_strpbrk, u*_strstr): Likewise.
* lib/unigbrk.in.h (u*_grapheme_next, u*_grapheme_prev): Likewise.

2 months agostring-buffer, string-buffer-reversed: Make OOM handling consistent.
Bruno Haible [Sun, 9 Feb 2025 15:56:39 +0000 (16:56 +0100)]
string-buffer, string-buffer-reversed: Make OOM handling consistent.

* lib/string-buffer.h (struct string_buffer): New field 'oom'.
* lib/string-buffer.c (sb_init): Initialize the 'oom' field.
(sb_append1, sb_append_desc, sb_append_c): Upon out-of-memory, set
buffer->oom, not buffer->error.
(sb_dupfree, sb_dupfree_c): If there was an OOM, return NULL.
* lib/string-buffer-printf.c (sb_appendvf, sb_appendf): Upon
out-of-memory, set buffer->oom, not buffer->error.
* lib/string-buffer-reversed.h (struct string_buffer_reversed): New
field 'oom'.
* lib/string-buffer-reversed.c (sbr_init): Initialize the 'oom' field.
(sbr_prepend1, sbr_prepend_desc, sbr_prepend_c): Upon out-of-memory, set
buffer->oom, not buffer->error.
(sbr_dupfree, sbr_dupfree_c): If there was an OOM, return NULL.
* lib/string-buffer-reversed-printf.c (sbr_prependvf, sbr_prependf):
Upon out-of-memory, set buffer->oom, not buffer->error.

2 months agounistr, unigbrk: Use const-improved function macros for 30 functions.
Bruno Haible [Sun, 9 Feb 2025 10:27:56 +0000 (11:27 +0100)]
unistr, unigbrk: Use const-improved function macros for 30 functions.

Reported by Kang-Che Sung <explorer09@gmail.com> in
<https://lists.gnu.org/archive/html/bug-libunistring/2025-02/msg00000.html>.

* lib/unistr.in.h (u*_check, u*_next, u*_prev): Define as macros that
cast the result to a non-const pointer when the argument is a non-const
pointer.
(u*_chr, u*_strchr, u*_strrchr, u*_strpbrk, u*_strstr): Define as macros
that cast the result to a const pointer when the argument is a const
pointer.
* lib/unistr/u8-check.c: Define _LIBUNISTRING_NO_CONST_GENERICS.
* lib/unistr/u16-check.c: Likewise.
* lib/unistr/u32-check.c: Likewise.
* lib/unistr/u8-next.c: Likewise.
* lib/unistr/u16-next.c: Likewise.
* lib/unistr/u32-next.c: Likewise.
* lib/unistr/u8-prev.c: Likewise.
* lib/unistr/u16-prev.c: Likewise.
* lib/unistr/u32-prev.c: Likewise.
* lib/unistr/u8-chr.c: Likewise.
* lib/unistr/u16-chr.c: Likewise.
* lib/unistr/u32-chr.c: Likewise.
* lib/unistr/u8-strchr.c: Likewise.
* lib/unistr/u16-strchr.c: Likewise.
* lib/unistr/u32-strchr.c: Likewise.
* lib/unistr/u8-strrchr.c: Likewise.
* lib/unistr/u16-strrchr.c: Likewise.
* lib/unistr/u32-strrchr.c: Likewise.
* lib/unistr/u8-strpbrk.c: Likewise.
* lib/unistr/u16-strpbrk.c: Likewise.
* lib/unistr/u32-strpbrk.c: Likewise.
* lib/unistr/u8-strstr.c: Likewise.
* lib/unistr/u16-strstr.c: Likewise.
* lib/unistr/u32-strstr.c: Likewise.
* lib/unigbrk.in.h (u*_grapheme_next, u*_grapheme_prev): Define as
macros that cast the result to a non-const pointer when the argument is
a non-const pointer.
* lib/unigbrk/u8-grapheme-next.c: Define _LIBUNISTRING_NO_CONST_GENERICS.
* lib/unigbrk/u16-grapheme-next.c: Likewise.
* lib/unigbrk/u32-grapheme-next.c: Likewise.
* lib/unigbrk/u8-grapheme-prev.c: Likewise.
* lib/unigbrk/u16-grapheme-prev.c: Likewise.
* lib/unigbrk/u32-grapheme-prev.c: Likewise.

2 months agombsstr, mbscasestr, mbspcasecmp: Fix use of 'typeof'.
Bruno Haible [Sun, 9 Feb 2025 10:16:03 +0000 (11:16 +0100)]
mbsstr, mbscasestr, mbspcasecmp: Fix use of 'typeof'.

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Perform array to
pointer conversion in argument of 'typeof'.

2 months agombsstr, mbscasestr, mbspcasecmp: Use const-improved C++ templates.
Bruno Haible [Sun, 9 Feb 2025 08:03:53 +0000 (09:03 +0100)]
mbsstr, mbscasestr, mbspcasecmp: Use const-improved C++ templates.

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): In C++, define
through a template that supports both 'char *' and 'const char *'.

2 months agombsstr, mbscasestr, mbspcasecmp: Use const-improved function macros.
Bruno Haible [Sun, 9 Feb 2025 07:18:18 +0000 (08:18 +0100)]
mbsstr, mbscasestr, mbspcasecmp: Use const-improved function macros.

* lib/string.in.h (mbsstr, mbspcasecmp, mbscasestr): Define as macros
that cast the result to 'const char *' when the first argument is a
'const char *'.
* lib/mbsstr.c: Define _GL_NO_CONST_GENERICS.
* lib/mbscasestr.c: Likewise.
* lib/mbspcasecmp.c: Likewise.

2 months agostdckdint-h tests: Fix compilation error (regression 2025-02-07).
Bruno Haible [Sun, 9 Feb 2025 07:04:30 +0000 (08:04 +0100)]
stdckdint-h tests: Fix compilation error (regression 2025-02-07).

* tests/test-intprops.c: Exclude INT_PROMOTE checks if TEST_STDCKDINT is
defined.

2 months agointprops tests: Strengthen INT_PROMOTE tests.
Bruno Haible [Sun, 9 Feb 2025 05:07:13 +0000 (06:07 +0100)]
intprops tests: Strengthen INT_PROMOTE tests.

* lib/intprops.h (INT_PROMOTE): Refine comment.
* tests/test-intprops.c: Check the size and sign of INT_PROMOTE (x) on
all compilers.
(main): Check that INT_PROMOTE is a no-op on floats.

2 months agodoc: Document free_aligned_sized and free_sized added in C23.
Collin Funk [Sun, 9 Feb 2025 01:40:48 +0000 (17:40 -0800)]
doc: Document free_aligned_sized and free_sized added in C23.

* doc/posix-functions/free_aligned_sized.texi: New file.
* doc/posix-functions/free_sized.texi: New file.
* doc/gnulib.texi (Functions in <stdlib.h>): Include them.

2 months agomemalignment: document
Paul Eggert [Sat, 8 Feb 2025 22:58:51 +0000 (14:58 -0800)]
memalignment: document

* doc/gnulib-readme.texi (Other portability assumptions):
Mention the C23 function memalignment.
* doc/posix-functions/memalignment.texi: New file.
* doc/gnulib.texi (Functions in <stdlib.h>): Include it.

2 months agodoc: some updates for glibc 2.41
Paul Eggert [Sat, 8 Feb 2025 22:31:04 +0000 (14:31 -0800)]
doc: some updates for glibc 2.41

2 months agointprops: new macro INT_PROMOTE
Paul Eggert [Fri, 7 Feb 2025 22:36:55 +0000 (14:36 -0800)]
intprops: new macro INT_PROMOTE

Something like this was requested for Emacs.
* doc/intprops.texi (Arithmetic Type Conversion): New section.
* lib/intprops.h (INT_PROMOTE): New macro.
* tests/test-intprops.c: Test it.

2 months agoerrno-h: document Haiku errors can’t be -1
Paul Eggert [Wed, 5 Feb 2025 21:24:41 +0000 (13:24 -0800)]
errno-h: document Haiku errors can’t be -1

* doc/posix-headers/errno.texi: Document Haiku errno range.

2 months agotest-xfail: Define a condition for Haiku.
Bruno Haible [Wed, 5 Feb 2025 21:04:02 +0000 (22:04 +0100)]
test-xfail: Define a condition for Haiku.

* modules/test-xfail (configure.ac): Define OS_IS_HAIKU conditional.

2 months agoxstring-buffer-reversed: New module.
Bruno Haible [Wed, 5 Feb 2025 20:04:34 +0000 (21:04 +0100)]
xstring-buffer-reversed: New module.

* lib/xstring-buffer-reversed.c: New file, based on
lib/xstring-buffer.c.
* lib/xstring-buffer-reversed-printf.c: New file, based on
lib/xstring-buffer-printf.c.
* modules/xstring-buffer-reversed: New file.

2 months agostring-buffer-reversed: Add tests.
Bruno Haible [Wed, 5 Feb 2025 19:59:04 +0000 (20:59 +0100)]
string-buffer-reversed: Add tests.

* tests/test-string-buffer-reversed.c: New file, based on
tests/test-string-buffer.c.
* modules/string-buffer-reversed-tests: New file.

2 months agostring-buffer-reversed: New module.
Bruno Haible [Wed, 5 Feb 2025 19:57:16 +0000 (20:57 +0100)]
string-buffer-reversed: New module.

* lib/string-buffer-reversed.h: New file, based on lib/string-buffer.h.
* lib/string-buffer-reversed.c: New file, based on lib/string-buffer.c.
* lib/string-buffer-reversed-printf.c: New file, based on
lib/string-buffer-printf.c.
* modules/string-buffer-reversed: New file.

2 months agostring-buffer: Improve comments.
Bruno Haible [Wed, 5 Feb 2025 19:38:35 +0000 (20:38 +0100)]
string-buffer: Improve comments.

* lib/string-buffer.h (struct string_buffer): Add a comment.

2 months agoautoupdate
Karl Berry [Tue, 4 Feb 2025 15:03:06 +0000 (07:03 -0800)]
autoupdate

2 months agognulib-tool: Fix the result of --create-testdir (regression yesterday).
Bruno Haible [Tue, 4 Feb 2025 11:00:50 +0000 (12:00 +0100)]
gnulib-tool: Fix the result of --create-testdir (regression yesterday).

* gnulib-tool.sh (func_emit_lib_Makefile_am): If $for_test, revert to
the previous code.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): If for_test, revert
to the previous code.

2 months ago*vasnprintf: Add a stricter runtime check.
Bruno Haible [Tue, 4 Feb 2025 10:46:34 +0000 (11:46 +0100)]
*vasnprintf: Add a stricter runtime check.

* lib/printf-args.c (PRINTF_FETCHARGS): Abort in case of an unknown
type.

2 months agobootstrap: Remove undesired output.
Bruno Haible [Tue, 4 Feb 2025 01:00:19 +0000 (02:00 +0100)]
bootstrap: Remove undesired output.

* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Silence the initial
branch hint.
* build-aux/bootstrap: Regenerated.

2 months agoc-vasnprintf: pacify -Wswitch-enum
Paul Eggert [Tue, 4 Feb 2025 00:47:36 +0000 (16:47 -0800)]
c-vasnprintf: pacify -Wswitch-enum

* lib/printf-args.c (PRINTF_FETCHARGS):
Mention TYPE_NONE as being a default case.
* lib/vasnprintf.c (VASNPRINTF): Use switch (+E).

2 months agognulib-tool: Allow compiler warnings in Gnulib code.
Bruno Haible [Mon, 3 Feb 2025 21:28:51 +0000 (22:28 +0100)]
gnulib-tool: Allow compiler warnings in Gnulib code.

* gnulib-tool.sh (func_emit_lib_Makefile_am): Append
$(GL_CFLAG_ALLOW_WARNINGS) to the ${libname}_${libext}_CFLAGS variable.
* pygnulib/GLEmiter.py (GLEmiter.lib_Makefile_am): Likewise.

2 months agognulib-tool: Apply libgnu.{,l}a specific CFLAGS to all its object files.
Bruno Haible [Mon, 3 Feb 2025 22:55:39 +0000 (23:55 +0100)]
gnulib-tool: Apply libgnu.{,l}a specific CFLAGS to all its object files.

* gnulib-tool.sh (func_emit_initmacro_end): Define
${macro_prefix}_${libname}_{LIBOBJS,LTLIBOBJS,LIBOBJDEPS} macros, that
include libname in the base name of the object files.
(func_emit_lib_Makefile_am): Use ${macro_prefix}_${libname}_*LIBOBJS
values instead of ${macro_prefix}_*LIBOBJS values.
* pygnulib/GLEmiter.py (GLEmiter.initmacro_end): Define
{macro_prefix_arg}_{libname}_{LIBOBJS,LTLIBOBJS,LIBOBJDEPS} macros, that
include libname in the base name of the object files.
(GLEmiter.lib_Makefile_am):Use {macro_prefix}_{libname}_*LIBOBJS
values instead of {macro_prefix}_*LIBOBJS values.

2 months agoautoupdate
Karl Berry [Mon, 3 Feb 2025 15:54:53 +0000 (07:54 -0800)]
autoupdate

3 months agoxstrtol-error: pacify -Wswitch-enum
Paul Eggert [Sun, 2 Feb 2025 23:34:05 +0000 (15:34 -0800)]
xstrtol-error: pacify -Wswitch-enum

* lib/xstrtol-error.c (xstrtol_error):
Enumerate all the enum values.

3 months agosavewd: pacify -Wswitch-enum
Paul Eggert [Sun, 2 Feb 2025 23:33:08 +0000 (15:33 -0800)]
savewd: pacify -Wswitch-enum

* lib/savewd.c (savewd_chdir, savewd_restore, savewd_finish):
Enumerate all the enum values.

3 months agoquotearg: pacify -Wswitch-enum
Paul Eggert [Sun, 2 Feb 2025 23:32:15 +0000 (15:32 -0800)]
quotearg: pacify -Wswitch-enum

* lib/quotearg.c (quotearg_buffer_restyled): Use switch (+E), and
omit default case, to pacify gcc -Wswitch-enum.  This is a good
way to pacify -Wswitch-enum when we don’t want to enumerate
all the enum values.  Omit unnecessary ‘default: break;’s.

3 months agotest-gettext-h: check call results
Paul Eggert [Sun, 2 Feb 2025 23:27:39 +0000 (15:27 -0800)]
test-gettext-h: check call results

* tests/test-gettext-h.c: Include string.h.
(main): Check return values of calls.
This also pacifies GCC, which otherwise might
warn about a variable being set but not used.

3 months agoannounce-gen: add comments
Paul Eggert [Sat, 1 Feb 2025 00:24:26 +0000 (16:24 -0800)]
announce-gen: add comments

* top/maint.mk: Add comments re recent change.

3 months agoannounce-gen: Allow 'make release' to work any day.
Simon Josefsson [Fri, 31 Jan 2025 23:58:45 +0000 (00:58 +0100)]
announce-gen: Allow 'make release' to work any day.

* top/maint.mk (today): Use regexp rather than current time.

3 months agoannounce-gen: Deal with 'guix --version'.
Simon Josefsson [Fri, 31 Jan 2025 23:24:27 +0000 (00:24 +0100)]
announce-gen: Deal with 'guix --version'.

* build-aux/announce-gen (get_tool_versions): Handle git commit
--versions.  Improve error message.

3 months agoFix last ChangeLog entry.
Collin Funk [Thu, 30 Jan 2025 02:24:42 +0000 (18:24 -0800)]
Fix last ChangeLog entry.

3 months agodoc: Document version-etc, version-etc, and argp-version-etc.
Collin Funk [Wed, 29 Jan 2025 04:52:17 +0000 (20:52 -0800)]
doc: Document version-etc, version-etc, and argp-version-etc.

* doc/version-etc.texi: New file.
* doc/gnulib.texi (Particular Modules): Include it.

3 months agogit-version-gen: Change suffix.
Bruno Haible [Tue, 28 Jan 2025 09:33:34 +0000 (10:33 +0100)]
git-version-gen: Change suffix.

* doc/package-version.texi (Propagating the package version): Drop the
git-version-gen postprocessing line, that does not work on Solaris.
* build-aux/git-version-gen: Likewise. Produce a suffix '-modified'
instead of '-dirty'.

3 months agopackage-version: Avoid compiler warnings in config.log.
Bruno Haible [Sun, 26 Jan 2025 12:26:35 +0000 (13:26 +0100)]
package-version: Avoid compiler warnings in config.log.

* m4/init-package-version.m4 (gl_INIT_PACKAGE_VERSION): Undefine
PACKAGE_VERSION and PACKAGE_STRING before redefining them.

3 months agofile-has-acl: Fix --with-libsmack option handling.
Bruno Haible [Sun, 26 Jan 2025 11:08:16 +0000 (12:08 +0100)]
file-has-acl: Fix --with-libsmack option handling.

* m4/acl.m4 (gl_FUNC_ACL_ARG): Add missing comma between macro
arguments.

3 months agobootstrap: Remove obsolete code.
Bruno Haible [Sun, 26 Jan 2025 03:29:59 +0000 (04:29 +0100)]
bootstrap: Remove obsolete code.

Reported by Basil L. Contovounesios <basil@contovou.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00221.html>.

* top/bootstrap-funclib.sh (package): Don't look at gl_INIT_PACKAGE
invocations.
* build-aux/bootstrap: Regenerated.

3 months agoptsname_r: Work around ptsname_r bug on Solaris 11 OmniOS.
Collin Funk [Sat, 25 Jan 2025 05:36:11 +0000 (21:36 -0800)]
ptsname_r: Work around ptsname_r bug on Solaris 11 OmniOS.

* lib/ptsname_r.c (ptsname_r): Ensure the resulting buffer is not
clobbered if it is too small on Solaris 11 OmniOS.
* m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): On Solaris 11 OmniOS, arrange to
override ptsname_r.
* doc/posix-functions/ptsname_r.texi: Document the bug.

3 months agostrerrorname_np: Work around a bug on Solaris 11 OmniOS.
Collin Funk [Sat, 25 Jan 2025 04:38:54 +0000 (20:38 -0800)]
strerrorname_np: Work around a bug on Solaris 11 OmniOS.

* m4/strerrorname_np.m4 (gl_CHECK_STRERRORNAME_NP): Test if
strerrorname_np returns NULL when given ERESTART or ESTRPIPE.
* doc/glibc-functions/strerrorname_np.texi: Document the bug.

3 months agopackage-version: Simplify further.
Bruno Haible [Sat, 25 Jan 2025 03:07:32 +0000 (04:07 +0100)]
package-version: Simplify further.

* doc/package-version.texi (Propagating the package version): Recommend
use of gl_INIT_PACKAGE_VERSION instead of gl_INIT_PACKAGE.
* build-aux/git-version-gen: Likewise.
* m4/init-package-version.m4: Likewise.
(gl_INIT_PACKAGE_VERSION): Renamed from gl_INIT_PACKAGE. Take only one
argument. Don't fiddle with AC_PACKAGE_NAME, AC_PACKAGE_TARNAME,
PACKAGE.
(gl_RPL_INIT_AUTOMAKE): Update.

3 months agopackage-version: Simplify its use.
Bruno Haible [Fri, 24 Jan 2025 21:03:29 +0000 (22:03 +0100)]
package-version: Simplify its use.

Reported by Basil L. Contovounesios <basil@contovou.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00195.html>.

* doc/package-version.texi (Propagating the package version): Recommend
to pass the usual arguments to AC_INIT.
* m4/init-package-version.m4: Likewise.
(gl_INIT_PACKAGE): Define PACKAGE_VERSION and PACKAGE_STRING as needed.
(gl_RPL_INIT_AUTOMAKE): Improve quoting.

3 months agotests: Fix a few compilation errors on Solaris 11 OmniOS with gcc 14.
Bruno Haible [Fri, 24 Jan 2025 19:06:06 +0000 (20:06 +0100)]
tests: Fix a few compilation errors on Solaris 11 OmniOS with gcc 14.

* tests/test-accept.c: Omit the signature check on Solaris.
* tests/test-gethostname.c: Likewise.
* tests/test-getpeername.c: Likewise.
* tests/test-getsockname.c: Likewise.
* tests/test-getsockopt.c: Likewise.
* tests/test-recvfrom.c: Likewise.
* doc/posix-functions/accept.texi: Mention the Solaris 11 OmniOS
problem.
* doc/posix-functions/gethostname.texi: Likewise.
* doc/posix-functions/getpeername.texi: Likewise.
* doc/posix-functions/getsockname.texi: Likewise.
* doc/posix-functions/getsockopt.texi: Likewise.
* doc/posix-functions/recvfrom.texi: Likewise.

3 months agosys_socket-h tests: Avoid compilation error on Solaris 11.4.
Bruno Haible [Fri, 24 Jan 2025 17:34:04 +0000 (18:34 +0100)]
sys_socket-h tests: Avoid compilation error on Solaris 11.4.

* doc/posix-headers/sys_socket.texi: Update.
* tests/test-sys_socket-h.c (main): Don't assume that all platforms that
have SOCK_CLOFORK also have MSG_CMSG_CLOFORK.

3 months agoFix last ChangeLog entry.
Collin Funk [Fri, 24 Jan 2025 05:33:57 +0000 (21:33 -0800)]
Fix last ChangeLog entry.

3 months agochar-h-c23: Fix compilation error on OmniOS.
Collin Funk [Fri, 24 Jan 2025 05:14:43 +0000 (21:14 -0800)]
char-h-c23: Fix compilation error on OmniOS.

* lib/lc-charset-unicode.c (locale_encoding_to_unicode)
(unicode_to_locale_encoding): Cast the argument to iconv with
ICONV_CONST.

3 months agobootstrap: Make it work with module 'package-version'.
Bruno Haible [Thu, 23 Jan 2025 20:39:35 +0000 (21:39 +0100)]
bootstrap: Make it work with module 'package-version'.

Reported by Basil L. Contovounesios <basil@contovou.net> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00195.html>.

* top/bootstrap-funclib.sh (normalize_package_name): New variable.
(extract_package_name): Don't normalize the package name here.
(package): Also look at the first argument of a gl_INIT_PACKAGE
invocation.
* build-aux/bootstrap: Regenerated.

3 months agoautoupdate
Karl Berry [Thu, 23 Jan 2025 14:59:53 +0000 (06:59 -0800)]
autoupdate

3 months agodoc: Document the workflows of the .tarball-version and .version files.
Bruno Haible [Thu, 23 Jan 2025 00:20:33 +0000 (01:20 +0100)]
doc: Document the workflows of the .tarball-version and .version files.

* build-aux/git-version-gen: Fix comments: Remove description of .version.

3 months agodoc: Document the workflows of the .tarball-version and .version files.
Bruno Haible [Wed, 22 Jan 2025 20:31:52 +0000 (21:31 +0100)]
doc: Document the workflows of the .tarball-version and .version files.

* doc/package-version.texi: New file.
* doc/gnulib.texi (Build Infrastructure Modules): Include it.
* build-aux/git-version-gen: Fix comments: Fix description of
.tarball-version. Recommend to invoke git-version-gen at configure time,
not at autoconf time. Remove description of .version. Rename Makefile
target 'tarball-version' to 'dist-tarball-version'.
* top/GNUmakefile: Improve comments.

3 months agoNew module 'version-stamp'.
Bruno Haible [Wed, 22 Jan 2025 20:25:27 +0000 (21:25 +0100)]
New module 'version-stamp'.

* m4/version-stamp.m4: New file.
* modules/version-stamp: New file.

3 months agoNew module 'package-version'.
Bruno Haible [Wed, 22 Jan 2025 20:21:59 +0000 (21:21 +0100)]
New module 'package-version'.

* m4/init-package-version.m4: New file, from GNU libunistring.
* modules/package-version: New file.
* modules/git-version-gen (Depends-on): Add it.

3 months agoflexmember: update comment
Paul Eggert [Mon, 20 Jan 2025 07:24:26 +0000 (23:24 -0800)]
flexmember: update comment

3 months agoattribute: Add note about ongoing standardization of some attributes.
Bruno Haible [Sun, 19 Jan 2025 09:40:02 +0000 (10:40 +0100)]
attribute: Add note about ongoing standardization of some attributes.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Add note that the meaning of
_GL_ATTRIBUTE_REPRODUCIBLE and _GL_ATTRIBUTE_UNSEQUENCED are likely to
change.
* lib/attribute.h (UNSEQUENCED, REPRODUCIBLE): Likewise.

3 months agorenameatu: Simplify configure test.
Bruno Haible [Sun, 19 Jan 2025 09:05:01 +0000 (10:05 +0100)]
renameatu: Simplify configure test.

* m4/renameat.m4 (gl_FUNC_RENAMEAT): Prepare the test scenario outside
of the test program. Use a bit mask as the test program's exit code.

3 months agoflexmember: port to IBM XL C 16.1
Paul Eggert [Sun, 19 Jan 2025 07:02:09 +0000 (23:02 -0800)]
flexmember: port to IBM XL C 16.1

* lib/flexmember.h (FLEXALIGNOF): Use the conservative definition
if _Alignof is a macro, to avoid a C99 conformance issue exposed
by IBM XL C 16.1 which otherwise complains "An aggregate
containing a flexible array member cannot be used as a member of a
structure or as an array element."

3 months agoalignasof: port to IBM XL C 16.1
Paul Eggert [Sun, 19 Jan 2025 06:06:55 +0000 (22:06 -0800)]
alignasof: port to IBM XL C 16.1

* doc/gnulib.texi (alignof):
Improve doc to match implementationa better.
* m4/stdalign.m4 (alignas): Do not define to _Alignas
if __xlC__ claims to conform to C11, because _Alignas fails with
weird diagnostics "Unexpected text %1$s encountered."
* tests/test-alignasof.c (TEST_ALIGNMENT, alignas):
Follow doc advice.

3 months agorenameatu: Work around a GNU/Hurd bug.
Collin Funk [Sun, 19 Jan 2025 05:06:49 +0000 (21:06 -0800)]
renameatu: Work around a GNU/Hurd bug.

* m4/renameat.m4 (gl_FUNC_RENAMEAT): Check if renameat2 handles trailing
slashes.
* doc/glibc-functions/renameat2.texi: Mention the GNU/Hurd bug.

3 months agolinkat tests: Revert the last change.
Collin Funk [Sun, 19 Jan 2025 02:00:55 +0000 (18:00 -0800)]
linkat tests: Revert the last change.

* tests/test-linkat.c (main): Disallow EINVAL an alternative error
value.
* doc/posix-functions/linkat.texi: Document the GNU/Hurd bug.

3 months agolinkat tests: Avoid failure on GNU/Hurd.
Collin Funk [Sun, 19 Jan 2025 00:34:14 +0000 (16:34 -0800)]
linkat tests: Avoid failure on GNU/Hurd.

* tests/test-linkat.c (main): Allow EINVAL an alternative error value.

3 months agoalignasof: port to IBM XL C V16.1
Paul Eggert [Sat, 18 Jan 2025 06:11:54 +0000 (22:11 -0800)]
alignasof: port to IBM XL C V16.1

* m4/stdalign.m4 (gl_ALIGNASOF):
Work around similar bug in IBM XL C V16.1.0 cc (non-clang).
Since this is the last version of this obsolescent compiler,
assume the bug is in earlier versions.

3 months agostdalign, stdnoreturn: improve deprecation warnings
Paul Eggert [Sat, 18 Jan 2025 05:08:27 +0000 (21:08 -0800)]
stdalign, stdnoreturn: improve deprecation warnings

* modules/stdalign, modules/stdalign-h, modules/stdnoreturn:
* modules/stdnoreturn-h: Use more consistent deprecation
warnings, that do not recommend a different deprecated module.

3 months agosys_stat-h: Ensure blksize_t and blkcnt_t are defined.
Bruno Haible [Fri, 17 Jan 2025 21:51:55 +0000 (22:51 +0100)]
sys_stat-h: Ensure blksize_t and blkcnt_t are defined.

* tests/test-sys_stat-h.c: Check that blksize_t and blkcnt_t are
defined. Include intprops.h. Check the signedness of various types.
* modules/sys_stat-h-tests (Depends-on): Add intprops.
* doc/posix-headers/sys_stat.texi: Mention the issues with blksize_t and
blkcnt_t.

3 months agosys_types-h: Ensure blksize_t and blkcnt_t are defined.
Bruno Haible [Fri, 17 Jan 2025 21:32:58 +0000 (22:32 +0100)]
sys_types-h: Ensure blksize_t and blkcnt_t are defined.

* lib/sys_types.in.h (blksize_t, blkcnt_t): New definitions.
* m4/sys_types_h.m4 (gl_SYS_TYPES_H): Set HAVE_BLKSIZE_T and
HAVE_BLKCNT_T.
* modules/sys_types-h (Makefile.am): Substitute HAVE_BLKSIZE_T and
HAVE_BLKCNT_T.
* tests/test-sys_types-h.c: Check that blksize_t and blkcnt_t are
defined. Include intprops.h. Check the signedness of various types.
* modules/sys_types-h-tests (Depends-on): Add assert-h, intprops.
* doc/posix-headers/sys_types.texi: Mention the issues with blksize_t
and blkcnt_t.

3 months agocrc-x86_64: port to old GCC compilers
Paul Eggert [Fri, 17 Jan 2025 18:39:38 +0000 (10:39 -0800)]
crc-x86_64: port to old GCC compilers

* m4/crc-x86_64.m4 (gl_CRC_X86_64_PCLMUL):
Check that the compiler supports __m128i_u, too,
since we’re using the type now.  Issue reported in
the same message from Lasse Collin.

3 months agocrc-x86_64: better fix for unaligned access
Paul Eggert [Fri, 17 Jan 2025 18:27:55 +0000 (10:27 -0800)]
crc-x86_64: better fix for unaligned access

Avoid undefined behavior in a way that doesn’t require
the input buffer to be aligned.
From a suggestion by Lasse Collin in:
https://lists.gnu.org/r/bug-gnulib/2025-01/msg00148.html
* lib/crc-x86_64-pclmul.c (crc32_update_no_xor_pclmul):
Since the const void * pointer ‘buf’ might not be aligned,
assign it to const __m128i_u * instead of to const __m128i *.
* lib/crc.c (crc32_update_no_xor):
Remove recently-addeda check for buffer alignment.

3 months agoAvoid -Wformat=security failures with --disable-nls
Pádraig Brady [Fri, 17 Jan 2025 13:01:40 +0000 (13:01 +0000)]
Avoid -Wformat=security failures with --disable-nls

This was noticed with GCC 14.

* lib/xmemcoll.c: Always use format arguments.
* lib/xprintf.c: Likewise.

3 months agocrc-x86_64: fix unaligned access
Paul Eggert [Fri, 17 Jan 2025 06:58:55 +0000 (22:58 -0800)]
crc-x86_64: fix unaligned access

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-01/msg00142.html
* lib/crc.c (crc32_update_no_xor): Don’t pass unaligned buffer to
crc32_update_no_xor_pclmul.  No doubt there is a higher
performance fix, perhaps involving advancing byte-by-byte along
the buffer until we get to an aligned boundary, but at least this
should fix the alignment bug.

3 months agogetopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).
Bruno Haible [Thu, 16 Jan 2025 22:10:10 +0000 (23:10 +0100)]
getopt-posix: Fix compilation error in C++ mode (regression 2024-09-21).

Reported by G. Branden Robinson <g.branden.robinson@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00135.html>.

* lib/getopt-pfx-core.h: On several platforms, include <unistd.h> first.
* modules/getopt-posix (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.

3 months agowchar_h: Fix for glibc 2.5.
Bruno Haible [Thu, 16 Jan 2025 20:14:45 +0000 (21:14 +0100)]
wchar_h: Fix for glibc 2.5.

* lib/wchar.in.h (__need_wint_t): Clean up after including glibc's
<wchar.h>.

3 months agofile-has-acl: handle listxattr returning ENOTSUP
Pádraig Brady [Wed, 15 Jan 2025 23:30:24 +0000 (23:30 +0000)]
file-has-acl: handle listxattr returning ENOTSUP

listxattr() was seen to return ENOTSUP on virtiofs,
which resulted in ls outputting "Not supported" errors.

* lib/file-has-acl.c (aclinfo_may_indicate_xattr): Treat any
non valid acl errno as being inconclusive as to whether there
are xattrs available.

3 months agolibgmp-mpz: Respect Automake's silent-rules.
Collin Funk [Thu, 16 Jan 2025 04:27:34 +0000 (20:27 -0800)]
libgmp-mpz: Respect Automake's silent-rules.

* modules/libgmp-mpz (Depends-on): Depend on gen-header.
(Makefile.am): Prefix commands with $(AM_V_GEN), $(gl_V_at), and
$(AM_V_at).

3 months agoassert-h: Fix compilation error with gcc >= 13 on Solaris 11.
Bruno Haible [Tue, 14 Jan 2025 21:47:43 +0000 (22:47 +0100)]
assert-h: Fix compilation error with gcc >= 13 on Solaris 11.

Reported by Pádraig Brady <P@draigBrady.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00120.html>.

* m4/assert_h.m4 (gl_ASSERT_H): Don't assume that on Solaris with gcc or
clang, static_assert works: /usr/include/assert.h is in the way.

3 months agogit-version-gen: Fix makefile rule typo, suggested by Bruno.
Simon Josefsson [Tue, 14 Jan 2025 15:21:08 +0000 (16:21 +0100)]
git-version-gen: Fix makefile rule typo, suggested by Bruno.

* build-aux/git-version-gen: Typo fix.