]> Savannah Git Hosting - gnulib.git/log
gnulib.git
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.

3 months agogit-version-gen: Use an indirect 'dist-hook' make rule instead.
Simon Josefsson [Tue, 14 Jan 2025 06:25:24 +0000 (07:25 +0100)]
git-version-gen: Use an indirect 'dist-hook' make rule instead.

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

3 months agofts, savedir: avoid glibc 2.2 readdir ENOENT bug
Paul Eggert [Mon, 13 Jan 2025 18:17:21 +0000 (10:17 -0800)]
fts, savedir: avoid glibc 2.2 readdir ENOENT bug

This is mostly to document the bug.
If these old platforms were still common I suppose we should
change the readdir module to work around it.  However, I’m not
sure it’s worth the hassle at this point.
* doc/posix-functions/readdir.texi, doc/posix-functions/readdir_r.texi:
Document the bug.
* lib/fts.c (fts_build):
* lib/savedir.c (streamsavedir):
Work around it.

3 months agostdlib-h: Define WCOREDUMP, as required by POSIX:2024.
Bruno Haible [Mon, 13 Jan 2025 09:04:04 +0000 (10:04 +0100)]
stdlib-h: Define WCOREDUMP, as required by POSIX:2024.

* lib/stdlib.in.h: Include <sys/wait.h> also when WCOREDUMP is not
defined.
* doc/posix-headers/stdlib.texi: Document the glibc bug.

3 months agocrc: Respect Automake's silent-rules.
Collin Funk [Mon, 13 Jan 2025 06:28:44 +0000 (22:28 -0800)]
crc: Respect Automake's silent-rules.

* modules/crc (Makefile.am): Add the $(AM_V_GEN) prefix before the
command.

3 months agoprogname: also set program_invocation_short_name
Pádraig Brady [Sun, 12 Jan 2025 16:47:57 +0000 (16:47 +0000)]
progname: also set program_invocation_short_name

* lib/progname.c (set_program_name): Keep program_invocation_name
and program_invocation_short_name consistent.

3 months agofile-has-acl: handle NFSv4 ACLs with listxattr returning EACCES
Pádraig Brady [Sat, 11 Jan 2025 16:40:33 +0000 (16:40 +0000)]
file-has-acl: handle NFSv4 ACLs with listxattr returning EACCES

* lib/file-has-acl.c (has_xattr): A new helper function to
lookup aclinfo for the xattr or fallback to getxattr() if appropriate.
(get_aclinfo): Use has_xattr() rather than aclinfo_has_xattr().
Discussed at <https://bugs.gnu.org/74692>

3 months agosys_un-h: Document the glibc bug.
Bruno Haible [Sat, 11 Jan 2025 14:45:30 +0000 (15:45 +0100)]
sys_un-h: Document the glibc bug.

Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00077.html>.

* doc/posix-headers/sys_un.texi: Mention the glibc bug.

3 months agosys_socket-h: Fix configuration mistake (regression yesterday).
Bruno Haible [Sat, 11 Jan 2025 14:38:49 +0000 (15:38 +0100)]
sys_socket-h: Fix configuration mistake (regression yesterday).

* m4/sys_socket_h.m4 (gl_SYS_SOCKET_H): Test
ac_cv_type_struct_sockaddr_storage after invoking
gl_PREREQ_SYS_SA_FAMILY, not before.

3 months agoeealloc, malloca: Fix module dependencies.
Bruno Haible [Sat, 11 Jan 2025 14:20:48 +0000 (15:20 +0100)]
eealloc, malloca: Fix module dependencies.

Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00077.html>.

* modules/eealloc (Depends-on): Add stdlib-h.
* modules/malloca (Depends-on): Likewise.

3 months agocanonicalize: Fix module dependencies.
Bruno Haible [Sat, 11 Jan 2025 14:19:57 +0000 (15:19 +0100)]
canonicalize: Fix module dependencies.

Reported by Miro Palmu <email@miropalmu.cc> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-01/msg00077.html>.

* modules/canonicalize (Depends-on): Add stdlib-h.

3 months agosys_un-h: Ensure that <sys/un.h> defines sa_family_t.
Bruno Haible [Fri, 10 Jan 2025 22:52:54 +0000 (23:52 +0100)]
sys_un-h: Ensure that <sys/un.h> defines sa_family_t.

* lib/sys_un.in.h: Include <sys/socket.h> or define sa_family_t
explicitly.
* m4/sys_socket_h.m4 (gl_PREREQ_SYS_SA_FAMILY): New macro, extracted
from gl_SYS_SOCKET_H.
(gl_SYS_SOCKET_H): Invoke it.
(gl_SYS_SOCKET_H_DEFAULTS): Don't initialize HAVE_SA_FAMILY_T.
* m4/sys_un_h.m4 (gl_SYS_UN_H): Invoke gl_PREREQ_SYS_SA_FAMILY. Test
whether <sys/un.h> defines sa_family_t. If not, set GL_GENERATE_SYS_UN_H
to true.
* modules/sys_un-h (Makefile.am): Substitute HAVE_SA_FAMILY_T,
HAVE_SA_FAMILY_T_IN_SYS_UN_H.
* tests/test-sys_un-h.c: Include intprops.h. Verify that sa_family_t is
defined and an unsigned integer type.
* modules/sys_un-h-tests (Depends-on): Add intprops.
* doc/posix-headers/sys_un.texi: Mention the problem with sa_family_t.

3 months agosys_wait-h: Document WCOREDUMP fix.
Bruno Haible [Fri, 10 Jan 2025 20:29:56 +0000 (21:29 +0100)]
sys_wait-h: Document WCOREDUMP fix.

* doc/posix-headers/sys_wait.texi: Mention the portability problem with
WCOREDUMP.

3 months agosys_wait-h tests: Check that WCOREDUMP is defined.
Collin Funk [Fri, 10 Jan 2025 19:34:06 +0000 (11:34 -0800)]
sys_wait-h tests: Check that WCOREDUMP is defined.

* tests/test-sys_wait-h.h (test_sys_wait_macros): Check that WCOREDUMP
is defined and can be used.

3 months agosys_wait-h: Update comment.
Collin Funk [Fri, 10 Jan 2025 19:27:29 +0000 (11:27 -0800)]
sys_wait-h: Update comment.

* lib/sys_wait.in.h (WCOREDUMP): Remove comment about this macro being
non-standardized since it was added by POSIX.1-2024.

3 months agodoc: document some file system portability issues
Paul Eggert [Fri, 10 Jan 2025 18:34:58 +0000 (10:34 -0800)]
doc: document some file system portability issues

* doc/glibc-functions/flistxattr.texi:
* doc/glibc-functions/listxattr.texi:
* doc/glibc-functions/llistxattr.texi:
* doc/posix-functions/fchdir.texi, doc/posix-functions/fstat.texi:
* doc/posix-functions/fstatvfs.texi:
Document some portability gotchas that Gnulib does not work around.

3 months agogitlog-to-changelog: Recommend more reliable Makefile rule idiom.
Bruno Haible [Fri, 10 Jan 2025 11:57:01 +0000 (12:57 +0100)]
gitlog-to-changelog: Recommend more reliable Makefile rule idiom.

Reported by Basil L. Contovounesios <basil@contovou.net>.

* doc/gitlog-to-changelog.texi: Make the gen-ChangeLog rule fail if the
ChangeLog file cannot be created or if the disk is full. Drop the use of
an intermediate file, not needed under $(distdir).

3 months agodoc: Fix syntax errors (regression yesterday).
Bruno Haible [Fri, 10 Jan 2025 11:41:35 +0000 (12:41 +0100)]
doc: Fix syntax errors (regression yesterday).

* doc/posix-headers/sys_socket.texi: Fix syntax errors.

3 months agofile-has-acl: port to Linux 6.12 + NFS listxattr
Paul Eggert [Fri, 10 Jan 2025 04:37:13 +0000 (20:37 -0800)]
file-has-acl: port to Linux 6.12 + NFS listxattr

* lib/file-has-acl.c (get_aclinfo): Try the getxattr-related calls
even if [l]listxattr fails with EACCES.  Problem reported by
Pádraig Brady <https://bugs.gnu.org/74692#25>.  Also, treat E2BIG
like EACCES.

3 months agosys_socket-h: Update for POSIX:2024.
Bruno Haible [Thu, 9 Jan 2025 09:12:00 +0000 (10:12 +0100)]
sys_socket-h: Update for POSIX:2024.

* doc/posix-headers/sys_socket.texi: Mention a variety of portability
problems.
* tests/test-sys_socket-h.c: Check for struct sockaddr,
struct sockaddr_storage, struct linger, SOL_SOCKET, SOMAXCONN.
Include macros.h.
(main): Check the socket types, socket options, and some MSG* constants.
* modules/sys_socket-h-tests (Files): Add tests/macros.h.

3 months agobootstrap: Support a tag name as GNULIB_REVISION.
Bruno Haible [Thu, 9 Jan 2025 08:37:41 +0000 (09:37 +0100)]
bootstrap: Support a tag name as GNULIB_REVISION.

* top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): If $GNULIB_REVISION
is a tag name, make sure to add that tag.
* build-aux/bootstrap: Regenerated.

3 months agosys_select-h: Define suseconds_t on native Windows.
Bruno Haible [Thu, 9 Jan 2025 01:08:34 +0000 (02:08 +0100)]
sys_select-h: Define suseconds_t on native Windows.

* lib/sys_select.in.h (suseconds_t): New type.
(GNULIB_defined_suseconds_t): New macro.

3 months agopselect: Document this module.
Bruno Haible [Wed, 8 Jan 2025 21:39:36 +0000 (22:39 +0100)]
pselect: Document this module.

* doc/posix-functions/pselect.texi: Document module 'pselect'.

3 months agosys_select-h: Update for POSIX:2024.
Bruno Haible [Wed, 8 Jan 2025 21:24:13 +0000 (22:24 +0100)]
sys_select-h: Update for POSIX:2024.

* lib/sys_select.in.h (rpl_fd_isset): Change type of second parameter to
'const fd_set *'.
* tests/test-sys_select-h.c: Check for some more types and for
FD_SETSIZE.
(FD_ISSET): Expect type of second parameter to be 'const fd_set *'.