]> Savannah Git Hosting - gnulib.git/log
gnulib.git
9 months agomath: Fix INFINITY and NAN on FreeBSD and AIX.
Bruno Haible [Thu, 1 Aug 2024 14:41:23 +0000 (16:41 +0200)]
math: Fix INFINITY and NAN on FreeBSD and AIX.

* doc/posix-headers/math.texi: Mention some FreeBSD and AIX bugs.
* lib/math.in.h (INFINITY): New macro.
(NAN): Replace also on FreeBSD < 8 and AIX. Use __builtin_nanf where
available.
(HUGE_VALF): Replace also on FreeBSD < 6. Use __builtin_inff where
available.
(HUGE_VAL): Replace also on FreeBSD < 6. Use __builtin_inf where
available.
(HUGE_VALL): Replace also on FreeBSD < 6. Use __builtin_infl where
available.
* tests/test-math.c: Check that INFINITY, NAN, HUGE_VALF, HUGE_VAL,
HUGE_VALL are constant expressions.
(main): Check the type of INFINITY and NAN.

9 months agoEnsure consistent effects of _LINUX_SOURCE_COMPAT.
Bruno Haible [Thu, 1 Aug 2024 11:52:30 +0000 (13:52 +0200)]
Ensure consistent effects of _LINUX_SOURCE_COMPAT.

* modules/extensions (configure.ac-early): New section.
* m4/extensions-aix.m4: New file.
* modules/extensions-aix: New file.
* m4/errno_h.m4 (gl_HEADER_ERRNO_H): Require gl_USE_AIX_EXTENSIONS,
instead of defining _LINUX_SOURCE_COMPAT at this stage.
* m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Likewise.
* m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Likewise.
* m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Likewise.
* m4/scandir.m4 (gl_FUNC_SCANDIR): Likewise.
* modules/errno (Depends-on): Add extensions-aix.
* modules/malloc-gnu (Depends-on): Likewise.
* modules/calloc-gnu (Depends-on): Likewise.
* modules/realloc-gnu (Depends-on): Likewise.
* modules/scandir (Depends-on): Likewise.

9 months agostrerror_r: Fix for AIX (regression yesterday).
Bruno Haible [Thu, 1 Aug 2024 11:24:10 +0000 (13:24 +0200)]
strerror_r: Fix for AIX (regression yesterday).

* lib/strerror_r.c: Ignore the value of STRERROR_R_CHAR_P on AIX.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Don't define
_LINUX_SOURCE_COMPAT, since it provides no advantage for strerror_r.

9 months agoerrno: make EEXIST != ENOTEMPTY on AIX
Paul Eggert [Thu, 1 Aug 2024 00:10:56 +0000 (17:10 -0700)]
errno: make EEXIST != ENOTEMPTY on AIX

Also, improve errno tests.
* m4/calloc.m4 (gl_FUNC_CALLOC_GNU):
* m4/malloc.m4 (gl_FUNC_MALLOC_GNU):
* m4/realloc.m4 (gl_FUNC_REALLOC_GNU):
* m4/scandir.m4 (gl_FUNC_SCANDIR):
Define _LINUX_SOURCE_COMPAT, as this can sometimes help on AIX.
* m4/errno_h.m4 (gl_HEADER_ERRNO_H):
Define _LINUX_SOURCE_COMPAT, to make EEXIST != ENOTEMPTY.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R):
Define _LINUX_SOURCE_COMPAT, in case someone else does.
* modules/errno-tests (Depends-on): Add assert-h, c99.
* tests/test-errno.c (e1, ..., e131): Remove, replacing with ...
(CHECK_POSIX_ERRNOS, POSITIVE_INTEGER_CONSTANT_EXPRESSION)
(INDEXED_BY_ERRNO, ERRNO_COUNT): These new macros.
Check that all errno values are positive integer constant expressions.
Check that they are all distinct, except perhaps for
EWOULDBLOCK == EAGAIN and ENOTSUP == EOPNOTSUPP.
Also check ESOCKTNOSUPPORT, added in POSIX.1-2024.
Also, check that errno values are distinct except when POSIX says
they needn’t be distinct, since POSIX.1-2024 gives license to
GNU/Linux’s non-distinct values.

9 months agofloat: Update to mostly guarantee ISO C 23 compliance.
Bruno Haible [Wed, 31 Jul 2024 22:46:49 +0000 (00:46 +0200)]
float: Update to mostly guarantee ISO C 23 compliance.

* doc/posix-headers/float.texi: Mention the various portability
problems.
* lib/float.in.h (FLT_HAS_SUBNORM, FLT_DECIMAL_DIG, FLT_TRUE_MIN,
DBL_HAS_SUBNORM, DBL_DECIMAL_DIG, DBL_TRUE_MIN, LDBL_HAS_SUBNORM,
LDBL_DECIMAL_DIG, LDBL_TRUE_MIN): New macros.
(gl_LDBL_TRUE_MIN): New declaration.
(FLT_IS_IEC_60559, FLT_NORM_MAX, FLT_SNAN, GNULIB_defined_FLT_SNAN,
DBL_IS_IEC_60559, DBL_NORM_MAX, DBL_SNAN, GNULIB_defined_DBL_SNAN,
LDBL_IS_IEC_60559, LDBL_NORM_MAX, LDBL_SNAN, GNULIB_defined_LDBL_SNAN):
New macros.
(gl_FLT_SNAN_t, gl_DBL_SNAN_t, gl_LDBL_SNAN_t): New types.
(gl_FLT_SNAN, gl_DBL_SNAN, gl_LDBL_SNAN): New declarations.
* lib/float.c (gl_LDBL_TRUE_MIN): New variable.
(gl_FLT_SNAN, gl_DBL_SNAN, gl_LDBL_SNAN): New variables.
* m4/float_h.m4 (gl_FLOAT_H): Add check whether float.h conforms to
ISO C23. Set REPLACE_FLOAT_SNAN.
* modules/float (configure.ac): Test also REPLACE_FLOAT_SNAN. Require
gl_BIGENDIAN.
* tests/test-float.c: Also check FLT_EVAL_METHOD, FLT_HAS_SUBNORM,
FLT_DECIMAL_DIG, FLT_IS_IEC_60559, FLT_TRUE_MIN, FLT_NORM_MAX,
DBL_HAS_SUBNORM, DBL_DECIMAL_DIG, DBL_IS_IEC_60559, DBL_TRUE_MIN,
DBL_NORM_MAX, LDBL_HAS_SUBNORM, LDBL_DECIMAL_DIG, LDBL_IS_IEC_60559.
Conditionally check LDBL_TRUE_MIN, LDBL_NORM_MAX.
Include isnanf-nolibm.h, isnand-nolibm.h, isnanl-nolibm.h.
(test_float): Check the values of FLT_HAS_SUBNORM, FLT_DECIMAL_DIG,
FLT_TRUE_MIN, FLT_IS_IEC_60559, FLT_NORM_MAX, FLT_SNAN.
(test_double): Check the values of DBL_HAS_SUBNORM, DBL_DECIMAL_DIG,
DBL_TRUE_MIN, DBL_IS_IEC_60559, DBL_NORM_MAX, DBL_SNAN.
(test_long_double): Check the values of LDBL_HAS_SUBNORM,
LDBL_DECIMAL_DIG, LDBL_TRUE_MIN, LDBL_IS_IEC_60559, LDBL_NORM_MAX,
LDBL_SNAN.
* modules/float-tests (Depends-on): Add isnanf-nolibm, isnand-nolibm,
isnanl-nolibm.

9 months agoattribute: Improve documentation.
Bruno Haible [Tue, 30 Jul 2024 20:01:27 +0000 (22:01 +0200)]
attribute: Improve documentation.

* lib/attribute.h: Clarify where to place the various attributes.

9 months agoReenable use of attributes in bracket syntax [[...]] (regr. yesterday).
Bruno Haible [Tue, 30 Jul 2024 17:22:40 +0000 (19:22 +0200)]
Reenable use of attributes in bracket syntax [[...]] (regr. yesterday).

* m4/gnulib-common.m4 (gl_COMMON_BODY): Add more comments. Don't define
_GL_BRACKET_USABLE.
* lib/c++defs.h (_GL_EXTERN_C_FUNC): New macro.
(_GL_FUNCDECL_RPL, _GL_FUNCDECL_RPL_1, _GL_FUNCDECL_SYS): Expect the
attributes in an optional 4th argument. Expand them before the return
type.
* lib/arpa_inet.in.h: Update all _GL_FUNCDECL_RPL and _GL_FUNCDECL_SYS
invocations.
* lib/dirent.in.h: Likewise.
* lib/error.in.h: Likewise.
* lib/fcntl.in.h: Likewise.
* lib/fnmatch.in.h: Likewise.
* lib/glob.in.h: Likewise.
* lib/iconv.in.h: Likewise.
* lib/inttypes.in.h: Likewise.
* lib/locale.in.h: Likewise.
* lib/malloc.in.h: Likewise.
* lib/math.in.h: Likewise.
* lib/monetary.in.h: Likewise.
* lib/netdb.in.h: Likewise.
* lib/pthread.in.h: Likewise.
* lib/search.in.h: Likewise.
* lib/signal.in.h: Likewise.
* lib/spawn.in.h: Likewise.
* lib/stdio.in.h: Likewise.
* lib/stdlib.in.h: Likewise.
* lib/string.in.h: Likewise.
* lib/sys_random.in.h: Likewise.
* lib/sys_resource.in.h: Likewise.
* lib/sys_socket.in.h: Likewise.
* lib/sys_stat.in.h: Likewise.
* lib/sys_time.in.h: Likewise.
* lib/threads.in.h: Likewise.
* lib/time.in.h: Likewise.
* lib/uchar.in.h: Likewise.
* lib/unistd.in.h: Likewise.
* lib/utime.in.h: Likewise.
* lib/wchar.in.h: Likewise.
* lib/wctype.in.h: Likewise.
* lib/c-vasprintf.h (c_aszprintf, c_vaszprintf, c_asprintf,
c_vasprintf): Move _GL_ATTRIBUTE_NODISCARD back to the beginning of the
declaration.

9 months agovaszprintf-posix tests: Fix a gcc warning.
Bruno Haible [Tue, 30 Jul 2024 01:14:00 +0000 (03:14 +0200)]
vaszprintf-posix tests: Fix a gcc warning.

* tests/test-vaszprintf-posix.c (test_function): Remove an unused
variable.

9 months agoUse attribute [[nodiscard]] wherever glibc uses __wur.
Bruno Haible [Tue, 30 Jul 2024 00:46:41 +0000 (02:46 +0200)]
Use attribute [[nodiscard]] wherever glibc uses __wur.

* lib/malloc.in.h (memalign): Mark with _GL_ATTRIBUTE_NODISCARD.
* lib/stdio.in.h (fdopen, fgets, fopen, fread, freopen, fscanf, ftell,
ftello, getdelim, getline, popen, scanf, tmpfile, vfscanf, vscanf):
Likewise.
* lib/stdlib.in.h (aligned_alloc, atoll, calloc, canonicalize_file_name,
getsubopt, malloc, mkdtemp, mkostemp, mkostemps, mkstemp, mkstemps,
posix_memalign, posix_openpt, ptsname, realloc, reallocarray, realpath,
rpmatch, secure_getenv): Likewise.
* lib/sys_random.in.h (getrandom): Likewise.
* lib/sys_stat.in.h (fchmodat): Likewise.
* lib/unistd.in.h (chown, dup, faccessat, fchdir, fchownat, ftruncate,
getcwd, getdomainname, getentropy, getgroups, lchown, link, linkat,
pipe, pipe2, pread, pwrite, read, readlink, readlinkat, sethostname,
symlink, symlinkat, truncate, ttyname_r, write): Likewise.

9 months agoAvoid g++ "warning: attributes are not permitted in this position".
Bruno Haible [Tue, 30 Jul 2024 00:02:43 +0000 (02:02 +0200)]
Avoid g++ "warning: attributes are not permitted in this position".

* m4/gnulib-common.m4 (gl_COMMON_BODY): Add more comments. Define
_GL_BRACKET_USABLE. Use it for _GL_ATTRIBUTE_DEPRECATED,
_GL_ATTRIBUTE_MAYBE_UNUSED, _GL_ATTRIBUTE_NODISCARD,
_GL_ATTRIBUTE_REPRODUCIBLE, _GL_ATTRIBUTE_UNSEQUENCED.
* lib/stdio.in.h (aszprintf, vaszprintf, asprintf, vasprintf): Move
_GL_ATTRIBUTE_NODISCARD to the same position as the other attributes.
* lib/c-vasprintf.h (c_aszprintf, c_vaszprintf, c_asprintf,
c_vasprintf): Likewise.

9 months agoAn update for clang >= 16.
Bruno Haible [Mon, 29 Jul 2024 20:20:32 +0000 (22:20 +0200)]
An update for clang >= 16.

* m4/gnulib-common.m4 (gl_COMMON_BODY): Don't define
_GL_BRACKET_BEFORE_ATTRIBUTE with clang++ 16 or newer.

9 months agoFix misspelling of __clang_major__.
Bruno Haible [Mon, 29 Jul 2024 19:59:44 +0000 (21:59 +0200)]
Fix misspelling of __clang_major__.

* lib/cdefs.h (__THROW, __THROWNL, __NTH, __NTHNL): Fix misspelled macro
name.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Likewise.
* lib/malloc.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/stddef.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/stdio.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/stdlib.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/string.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/sys_stat.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.
* lib/wchar.in.h (_GL_ATTRIBUTE_NOTHROW): Likewise.

9 months agochdir: Fix mistake in GNULIB_POSIXCHECK.
Bruno Haible [Mon, 29 Jul 2024 18:21:06 +0000 (20:21 +0200)]
chdir: Fix mistake in GNULIB_POSIXCHECK.

* lib/unistd.in.h: Don't attach the chdir warning to the 'chown'
function.

9 months agoatoll: Fix module dependencies.
Bruno Haible [Mon, 29 Jul 2024 18:17:06 +0000 (20:17 +0200)]
atoll: Fix module dependencies.

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

9 months agovasprintf, c-vasprintf: Remind users to consider the return value.
Bruno Haible [Mon, 29 Jul 2024 15:31:13 +0000 (17:31 +0200)]
vasprintf, c-vasprintf: Remind users to consider the return value.

* lib/stdio.in.h (aszprintf, vaszprintf, asprintf, vasprintf): Mark with
_GL_ATTRIBUTE_NODISCARD.
* lib/c-vasprintf.h (c_aszprintf, c_vaszprintf, c_asprintf,
c_vasprintf): Likewise.

9 months agoxstrtol, xstrtoll tests: Avoid test failure after 2024-07-25 change.
Bruno Haible [Mon, 29 Jul 2024 14:46:02 +0000 (16:46 +0200)]
xstrtol, xstrtoll tests: Avoid test failure after 2024-07-25 change.

* tests/test-xstrtol.c (main): Update expected test results.

9 months agoxstrtol, xstrtoll tests: Avoid test failure after 2024-07-25 change.
Bruno Haible [Mon, 29 Jul 2024 12:54:18 +0000 (14:54 +0200)]
xstrtol, xstrtoll tests: Avoid test failure after 2024-07-25 change.

* tests/test-xstrtol.c (main): Update expected test results.

9 months agologp1l: Add tests.
Bruno Haible [Mon, 29 Jul 2024 11:42:05 +0000 (13:42 +0200)]
logp1l: Add tests.

* tests/test-logp1l.c: New file, based on tests/test-log1pl.c.
* modules/logp1l-tests: New file.

9 months agologp1l: New module.
Bruno Haible [Mon, 29 Jul 2024 11:38:46 +0000 (13:38 +0200)]
logp1l: New module.

* lib/math.in.h (logp1l): New declaration.
* lib/logp1l.c: New file.
* m4/logp1l.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether logp1l is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_LOGP1L.
(gl_MATH_H_DEFAULTS): Initialize HAVE_LOGP1L.
* modules/math (Makefile.am): Substitute GNULIB_LOGP1L, HAVE_LOGP1L.
* modules/logp1l: New file.
* doc/posix-functions/logp1l.texi: Mention the new module.

9 months agologp1f: Add tests.
Bruno Haible [Mon, 29 Jul 2024 11:19:33 +0000 (13:19 +0200)]
logp1f: Add tests.

* tests/test-logp1f.c: New file, based on tests/test-log1pf.c.
* modules/logp1f-tests: New file.

9 months agologp1f: New module.
Bruno Haible [Mon, 29 Jul 2024 11:15:23 +0000 (13:15 +0200)]
logp1f: New module.

* lib/math.in.h (logp1f): New declaration.
* lib/logp1f.c: New file.
* m4/logp1f.m4: New file.
* m4/log1p.m4 (gl_FUNC_LOG1P): Define through AC_DEFUN_ONCE.
* m4/isnand.m4 (gl_FUNC_ISNAND): Define through AC_DEFUN_ONCE.
* m4/math_h.m4 (gl_MATH_H): Test whether logp1f is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_LOGP1F.
(gl_MATH_H_DEFAULTS): Initialize HAVE_LOGP1F.
* modules/math (Makefile.am): Substitute GNULIB_LOGP1F, HAVE_LOGP1F.
* modules/logp1f: New file.
* doc/posix-functions/logp1f.texi: Mention the new module.

9 months agologp1: Add tests.
Bruno Haible [Mon, 29 Jul 2024 01:56:28 +0000 (03:56 +0200)]
logp1: Add tests.

* tests/test-logp1.c: New file, based on tests/test-log1p.c.
* modules/logp1-tests: New file.

9 months agologp1: New module.
Bruno Haible [Mon, 29 Jul 2024 01:24:51 +0000 (03:24 +0200)]
logp1: New module.

* lib/math.in.h (logp1): New declaration.
* lib/logp1.c: New file.
* m4/logp1.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether logp1 is declared.
(gl_MATH_H_REQUIRE_DEFAULTS): Initialize GNULIB_LOGP1.
(gl_MATH_H_DEFAULTS): Initialize HAVE_LOGP1.
* modules/math (Makefile.am): Substitute GNULIB_LOGP1, HAVE_LOGP1.
* modules/logp1: New file.
* doc/posix-functions/logp1.texi: Mention the new module.

9 months agoMore updates regarding the 'Useable-in-testdir' sections.
Bruno Haible [Mon, 29 Jul 2024 01:35:23 +0000 (03:35 +0200)]
More updates regarding the 'Useable-in-testdir' sections.

* gnulib-tool.sh (sed_extract_prog, sed_extract_field_header): Recognize
the 'Useable-in-testdir' sections.
* modules/TEMPLATE-EXTENDED: Add a 'Useable-in-testdir' section.
* doc/gnulib.texi (Module description): Move new text.

9 months agodoc: Document the 'Useable-in-testdir' field in module descriptions.
Collin Funk [Mon, 29 Jul 2024 01:20:06 +0000 (18:20 -0700)]
doc: Document the 'Useable-in-testdir' field in module descriptions.

* doc/gnulib.texi (Module description): Add the 'Usable-in-testdir'
field.

9 months agognulib-tool.py: New options --extract-[recursive-]dependents.
Bruno Haible [Sun, 28 Jul 2024 23:26:51 +0000 (01:26 +0200)]
gnulib-tool.py: New options --extract-[recursive-]dependents.

* pygnulib/GLInfo.py (GLInfo.usage): Document --extract-dependents and
--extract-recursive-dependents options.
* pygnulib/GLModuleSystem.py (GLModule.getDependenciesRecursively): Move
method.
(getDependents, getDependentsRecursively): New methods.
* pygnulib/main.py (main): Add support for --extract-dependents and
--extract-recursive-dependents.

9 months agognulib-tool.py: Avoid adding specific modules to a testdir.
Bruno Haible [Sun, 28 Jul 2024 21:52:04 +0000 (23:52 +0200)]
gnulib-tool.py: Avoid adding specific modules to a testdir.

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00292.html>.

* pygnulib/GLInfo.py (GLInfo.usage): Document
--extract-usability-in-testdir option.
* pygnulib/GLModuleSystem.py (GLModule.section_label_pattern): Recognize
Usable-in-testdir section.
(GLModule.getUsabilityInTestdir): New function.
* pygnulib/GLTestDir.py (GLTestDir.execute): Invoke it to filter out
modules to avoid. Warn if such a module was specified.
* pygnulib/main.py (main): Add support for
--extract-usability-in-testdir. Provide an error message for error 24.
* pygnulib/GLError.py: Likewise.
* modules/config-h (Usable-in-testdir): New section.
* modules/lib-ignore (Usable-in-testdir): New section.
* modules/mountlist (Usable-in-testdir): New section.
* modules/non-recursive-gnulib-prefix-hack (Usable-in-testdir): New
section.
* modules/timevar (Usable-in-testdir): New section.
(Files): Remove lib/timevar.def.

9 months agognulib-tool.py: Fix an exception message.
Bruno Haible [Sun, 28 Jul 2024 21:38:45 +0000 (23:38 +0200)]
gnulib-tool.py: Fix an exception message.

* pygnulib/GLModuleSystem.py (GLModuleSystem.find): Raise error 23,
not 3.
* pygnulib/GLError.py: Provide an error message for error 23.
* pygnulib/main.py: Likewise.

9 months agoautoupdate
Paul Eggert [Sun, 28 Jul 2024 20:07:43 +0000 (13:07 -0700)]
autoupdate

9 months agomaint: remove ‘coding: utf-8’ on ASCII
Paul Eggert [Sun, 28 Jul 2024 19:37:13 +0000 (12:37 -0700)]
maint: remove ‘coding: utf-8’ on ASCII

These days, ‘coding: utf-8’ tags aren’t needed in general,
as Emacs typically defaults to UTF-8, and Emacs itself now
has many untagged source files in UTF-8.  However, for now let’s
just remove the tags when they are on ASCII files.
* lib/md5-stream.c, lib/sha1-stream.c, lib/sha256-stream.c:
* lib/sm3-stream.c: Remove unnecessary coding: lines.

9 months agomaint: remove coding: that did not work
Paul Eggert [Sun, 28 Jul 2024 19:28:13 +0000 (12:28 -0700)]
maint: remove coding: that did not work

* m4/fnmatch.m4, m4/fpieee.m4, m4/mbrlen.m4, m4/mbrtowc.m4:
Remove ineffective coding: strings.

9 months agostd-gnu23: new module
Paul Eggert [Sun, 28 Jul 2024 19:11:30 +0000 (12:11 -0700)]
std-gnu23: new module

The plan is to update the c99 module to depend on std-gnu23
instead of on std-gnu11, and to make std-gnu11 obsolete.
A benefit of this will be that c99 will no longer affect C++.
For now, though, std-gnu23 is simply a new, optional module.
* MODULES.html.sh (func_all_modules): Add it.
* modules/std-gnu11: Change description.
* modules/std-gnu23, m4/std-gnu23.m4: New files.
* m4/std-gnu11.m4: Do nothing if _AC_C_C23_OPTIONS is defined.
(AC_PROG_CC): Use AC_DEFUN, not AC_DEFUN_ONCE, so that
we can be superseded.

9 months agotimevar: add missing timevar.def
Paul Eggert [Sun, 28 Jul 2024 17:09:44 +0000 (10:09 -0700)]
timevar: add missing timevar.def

* modules/timevar (Files): Add timevar.def.

9 months agostrftime: improve doc
Paul Eggert [Sun, 28 Jul 2024 17:07:36 +0000 (10:07 -0700)]
strftime: improve doc

* lib/strftime.h: In comment, use active voice, reword errno
description for clarity, and omit reference to draft POSIX 202x to
simplify future maintenance.

9 months agodoc: Remove HTML code tags from Texinfo files.
Collin Funk [Sat, 27 Jul 2024 21:15:33 +0000 (14:15 -0700)]
doc: Remove HTML code tags from Texinfo files.

* doc/posix-functions/alarm.texi (alarm): Use @code{} instead of
<code></code>.
* doc/posix-headers/sys_un.texi (sys/un.h): Likewise.

9 months agomaintainer-makefile: Fix yesterdays #include <...> change.
Collin Funk [Sat, 27 Jul 2024 19:16:37 +0000 (12:16 -0700)]
maintainer-makefile: Fix yesterdays #include <...> change.

* top/maint.mk (gl_prefer_angle_bracket_headers_): Remove files that
don't include #include_next. Sort using the C locale.

9 months agodoc: Fix yesterdays #include <...> change.
Collin Funk [Sat, 27 Jul 2024 19:10:32 +0000 (12:10 -0700)]
doc: Fix yesterdays #include <...> change.

* doc/gnulib-tool.texi (Style of #include statements): Remove files that
don't include #include_next. Sort using the C locale.

9 months agomaintainer-makefile: Update list of headers to use #include <...>.
Collin Funk [Sat, 27 Jul 2024 04:30:56 +0000 (21:30 -0700)]
maintainer-makefile: Update list of headers to use #include <...>.

* top/maint.mk (gl_prefer_angle_bracket_headers_):  Add missing headers
from lib/*.in.h. Re-sort list.

9 months agodoc: Update list of headers to use #include <...>.
Collin Funk [Sat, 27 Jul 2024 04:11:20 +0000 (21:11 -0700)]
doc: Update list of headers to use #include <...>.

* doc/gnulib-tool.texi (Style of #include statements): Add missing
headers from lib/*.in.h. Re-sort list.

9 months agosys_time, sys_types: Remove sys directory at 'make mostlyclean'.
Collin Funk [Sat, 27 Jul 2024 01:37:09 +0000 (18:37 -0700)]
sys_time, sys_types: Remove sys directory at 'make mostlyclean'.

* modules/sys_time (Makefile.am): Add sys to MOSTLYCLEANDIRS.
* modules/sys_types (Makefile.am): Likewise.

9 months agosys_un: Avoid compilation error in C++ <string.h> on glibc systems.
Bruno Haible [Fri, 26 Jul 2024 11:04:09 +0000 (13:04 +0200)]
sys_un: Avoid compilation error in C++ <string.h> on glibc systems.

* m4/sys_un_h.m4 (gl_SYS_UN_H): Require AC_CANONICAL_HOST. Set
GL_GENERATE_SYS_UN_H to true on glibc systems. Invoke
gl_CHECK_NEXT_HEADERS. Initialize HAVE_SYS_UN_H.
* lib/sys_un.in.h: Use include_next and a split double-inclusion guard.
In C++ mode, include <stddef.h> and <string.h> first.
* modules/sys_un (Depends-on): Add include_next.
(Makefile.am): Substitute INCLUDE_NEXT, PRAGMA_SYSTEM_HEADER,
PRAGMA_COLUMNS, NEXT_SYS_UN_H, HAVE_SYS_UN_H. Arrange to remove 'sys'
directory at "make mostlyclean".

9 months agoxstrtol, xstrtoll tests: Improve comment.
Bruno Haible [Fri, 26 Jul 2024 09:32:27 +0000 (11:32 +0200)]
xstrtol, xstrtoll tests: Improve comment.

* tests/test-xstrtol.c (main): Clarify that the new test exercises
undefined behaviour.

9 months agoxstrtol: remove the base-checking changes
Paul Eggert [Fri, 26 Jul 2024 00:24:20 +0000 (17:24 -0700)]
xstrtol: remove the base-checking changes

* lib/xstrtol.c (__xstrtol): Stop worrying about hypothetical
implementations that are causing more confusion than the code is
worth.  Instead, go back more to old way of doing things.
None of this matters for practical applications.
* lib/xstrtol.h: Document that behavior is undefined
if the base is negative, 1, or greater than 36.
* modules/xstrtol (Depends-on): Remove nullptr; no longer needed.

9 months agoxstrtol, xstrtoll tests: Avoid test failure on FreeBSD.
Bruno Haible [Thu, 25 Jul 2024 21:45:23 +0000 (23:45 +0200)]
xstrtol, xstrtoll tests: Avoid test failure on FreeBSD.

* tests/test-xstrtol.c (main): Adjust expected results for FreeBSD.

9 months agoxstrtol, xstrtoll tests: Test behaviour for an invalid base.
Bruno Haible [Thu, 25 Jul 2024 20:05:18 +0000 (22:05 +0200)]
xstrtol, xstrtoll tests: Test behaviour for an invalid base.

Reported by Alejandro Colomar <alx@kernel.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00249.html>.

* modules/xstrtol-tests (Files): Add tests/macros.h.
* modules/xstrtoll-tests (Files): Likewise.
* tests/test-xstrtol.c: Include macros.h.
(main): If no arguments are given on the command line, perform
miscellaneous tests.
* tests/test-xstrtol.sh: Also invoke test-xstrtol without arguments.
* tests/test-xstrtoll.sh: Also invoke test-xstrtoll without arguments.

9 months agosys_un: Add C++ tests.
Collin Funk [Thu, 25 Jul 2024 03:27:46 +0000 (20:27 -0700)]
sys_un: Add C++ tests.

* modules/sys_un-c++-tests: New file.
* tests/test-sys_un-c++.cc: New file.
* modules/sys_un-tests (Depends-on): Add sys_un-c++-tests.

9 months agosys_un: Add tests.
Collin Funk [Thu, 25 Jul 2024 03:16:26 +0000 (20:16 -0700)]
sys_un: Add tests.

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

9 months agosys_un: New module.
Collin Funk [Thu, 25 Jul 2024 03:14:49 +0000 (20:14 -0700)]
sys_un: New module.

* doc/posix-headers/sys_un.texi (sys/un.h): Mention it.
* lib/sys_un.in.h: New file.
* m4/sys_un_h.m4: New file.
* modules/sys_un: New file.

9 months agoxstrtol: improve xstrtol.h comment
Paul Eggert [Thu, 25 Jul 2024 00:00:13 +0000 (17:00 -0700)]
xstrtol: improve xstrtol.h comment

9 months agoAvoid false select_used_without_requesting_gnulib_module_select.
Bruno Haible [Wed, 24 Jul 2024 23:29:22 +0000 (01:29 +0200)]
Avoid false select_used_without_requesting_gnulib_module_select.

* modules/select (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_select.in.h (select): Don't define to
select_used_without_requesting_gnulib_module_select if the gnulib module
'select' is in use under the same configure.ac.

9 months agoAvoid false shutdown_used_without_requesting_gnulib_module_shutdown.
Bruno Haible [Wed, 24 Jul 2024 23:27:32 +0000 (01:27 +0200)]
Avoid false shutdown_used_without_requesting_gnulib_module_shutdown.

* modules/shutdown (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (shutdown): Don't define to
shutdown_used_without_requesting_gnulib_module_shutdown if the gnulib
module 'shutdown' is in use under the same configure.ac.

9 months agoAvoid false setsockopt_used_without_requesting_gnulib_module_setsockopt.
Bruno Haible [Wed, 24 Jul 2024 23:23:52 +0000 (01:23 +0200)]
Avoid false setsockopt_used_without_requesting_gnulib_module_setsockopt.

* modules/setsockopt (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (setsockopt): Don't define to
setsockopt_used_without_requesting_gnulib_module_setsockopt if the
gnulib module 'setsockopt' is in use under the same configure.ac.

9 months agoAvoid false sendto_used_without_requesting_gnulib_module_sendto.
Bruno Haible [Wed, 24 Jul 2024 23:21:45 +0000 (01:21 +0200)]
Avoid false sendto_used_without_requesting_gnulib_module_sendto.

* modules/sendto (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (sendto): Don't define to
sendto_used_without_requesting_gnulib_module_sendto if the gnulib module
'sendto' is in use under the same configure.ac.

9 months agoAvoid false recvfrom_used_without_requesting_gnulib_module_recvfrom.
Bruno Haible [Wed, 24 Jul 2024 23:19:20 +0000 (01:19 +0200)]
Avoid false recvfrom_used_without_requesting_gnulib_module_recvfrom.

* modules/recvfrom (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (recvfrom): Don't define to
recvfrom_used_without_requesting_gnulib_module_recvfrom if the gnulib
module 'recvfrom' is in use under the same configure.ac.

9 months agoAvoid false send_used_without_requesting_gnulib_module_send.
Bruno Haible [Wed, 24 Jul 2024 23:17:33 +0000 (01:17 +0200)]
Avoid false send_used_without_requesting_gnulib_module_send.

* modules/send (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (send): Don't define to
send_used_without_requesting_gnulib_module_send if the gnulib module
'send' is in use under the same configure.ac.

9 months agoAvoid false recv_used_without_requesting_gnulib_module_recv.
Bruno Haible [Wed, 24 Jul 2024 23:16:05 +0000 (01:16 +0200)]
Avoid false recv_used_without_requesting_gnulib_module_recv.

* modules/recv (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (recv): Don't define to
recv_used_without_requesting_gnulib_module_recv if the gnulib module
'recv' is in use under the same configure.ac.

9 months agoAvoid false listen_used_without_requesting_gnulib_module_listen.
Bruno Haible [Wed, 24 Jul 2024 23:14:25 +0000 (01:14 +0200)]
Avoid false listen_used_without_requesting_gnulib_module_listen.

* modules/listen (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (listen): Don't define to
listen_used_without_requesting_gnulib_module_listen if the gnulib module
'listen' is in use under the same configure.ac.

9 months agoAvoid false getsockopt_used_without_requesting_gnulib_module_getsockopt.
Bruno Haible [Wed, 24 Jul 2024 23:12:43 +0000 (01:12 +0200)]
Avoid false getsockopt_used_without_requesting_gnulib_module_getsockopt.

* modules/getsockopt (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (getsockopt): Don't define to
getsockopt_used_without_requesting_gnulib_module_getsockopt if the
gnulib module 'getsockopt' is in use under the same configure.ac.

9 months agoAvoid false getsockname_used_without_requesting_gnulib_module_getsockname.
Bruno Haible [Wed, 24 Jul 2024 22:53:05 +0000 (00:53 +0200)]
Avoid false getsockname_used_without_requesting_gnulib_module_getsockname.

* modules/getsockname (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (getsockname): Don't define to
getsockname_used_without_requesting_gnulib_module_getsockname if the
gnulib module 'getsockname' is in use under the same configure.ac.

9 months agoAvoid false getpeername_used_without_requesting_gnulib_module_getpeername.
Bruno Haible [Wed, 24 Jul 2024 22:51:27 +0000 (00:51 +0200)]
Avoid false getpeername_used_without_requesting_gnulib_module_getpeername.

* modules/getpeername (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (getpeername): Don't define to
getpeername_used_without_requesting_gnulib_module_getpeername if the
gnulib module 'getpeername' is in use under the same configure.ac.

9 months agoAvoid false bind_used_without_requesting_gnulib_module_bind.
Bruno Haible [Wed, 24 Jul 2024 22:49:21 +0000 (00:49 +0200)]
Avoid false bind_used_without_requesting_gnulib_module_bind.

* modules/bind (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (bind): Don't define to
bind_used_without_requesting_gnulib_module_bind if the gnulib module
'bind' is in use under the same configure.ac.

9 months agoAvoid false accept_used_without_requesting_gnulib_module_accept.
Bruno Haible [Wed, 24 Jul 2024 22:47:45 +0000 (00:47 +0200)]
Avoid false accept_used_without_requesting_gnulib_module_accept.

* modules/accept (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (accept): Don't define to
accept_used_without_requesting_gnulib_module_accept if the gnulib module
'accept' is in use under the same configure.ac.

9 months agoAvoid false socket_used_without_requesting_gnulib_module_connect.
Bruno Haible [Wed, 24 Jul 2024 22:41:00 +0000 (00:41 +0200)]
Avoid false socket_used_without_requesting_gnulib_module_connect.

* modules/connect (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (connect): Don't define to
socket_used_without_requesting_gnulib_module_connect if the gnulib
module 'connect' is in use under the same configure.ac. Fix typo.

9 months agoAvoid false socket_used_without_requesting_gnulib_module_socket.
Bruno Haible [Wed, 24 Jul 2024 22:38:08 +0000 (00:38 +0200)]
Avoid false socket_used_without_requesting_gnulib_module_socket.

* modules/socket (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_socket.in.h (socket): Don't define to
socket_used_without_requesting_gnulib_module_socket if the gnulib module
'socket' is in use under the same configure.ac.

9 months agoAvoid false lstat_used_without_requesting_gnulib_module_lstat.
Bruno Haible [Wed, 24 Jul 2024 22:36:01 +0000 (00:36 +0200)]
Avoid false lstat_used_without_requesting_gnulib_module_lstat.

* modules/lstat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (lstat): Don't define to
lstat_used_without_requesting_gnulib_module_lstat if the gnulib module
'lstat' is in use under the same configure.ac.

9 months agoAvoid false fstatat_used_without_requesting_gnulib_module_fstatat.
Bruno Haible [Wed, 24 Jul 2024 22:34:09 +0000 (00:34 +0200)]
Avoid false fstatat_used_without_requesting_gnulib_module_fstatat.

* modules/fstatat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (fstatat): Don't define to
fstatat_used_without_requesting_gnulib_module_fstatat if the gnulib
module 'fstatat' is in use under the same configure.ac.

9 months agoAvoid false fstat_used_without_requesting_gnulib_module_fstat.
Bruno Haible [Wed, 24 Jul 2024 22:32:26 +0000 (00:32 +0200)]
Avoid false fstat_used_without_requesting_gnulib_module_fstat.

* modules/fstat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (fstat): Don't define to
fstat_used_without_requesting_gnulib_module_fstat if the gnulib module
'fstat' is in use under the same configure.ac.

9 months agoAvoid false stat_used_without_requesting_gnulib_module_stat.
Bruno Haible [Wed, 24 Jul 2024 22:30:26 +0000 (00:30 +0200)]
Avoid false stat_used_without_requesting_gnulib_module_stat.

* modules/stat (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_stat.in.h (stat): Don't define to
stat_used_without_requesting_gnulib_module_stat if the gnulib module
'stat' is in use under the same configure.ac.

9 months agoAvoid false ioctl_used_without_requesting_gnulib_module_ioctl.
Bruno Haible [Wed, 24 Jul 2024 21:59:15 +0000 (23:59 +0200)]
Avoid false ioctl_used_without_requesting_gnulib_module_ioctl.

* modules/ioctl (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/sys_ioctl.in.h (ioctl): Don't define to
ioctl_used_without_requesting_gnulib_module_ioctl if the gnulib module
'ioctl' is in use under the same configure.ac.

9 months agoAvoid false localeconv_used_without_requesting_gnulib_module_localeconv.
Bruno Haible [Wed, 24 Jul 2024 21:56:33 +0000 (23:56 +0200)]
Avoid false localeconv_used_without_requesting_gnulib_module_localeconv.

* modules/localeconv (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/locale.in.h (localeconv): Don't define to
localeconv_used_without_requesting_gnulib_module_localeconv if the
gnulib module 'localeconv' is in use under the same configure.ac.

9 months agoAvoid false gethostname_used_without_requesting_gnulib_module_gethostname.
Bruno Haible [Wed, 24 Jul 2024 21:53:53 +0000 (23:53 +0200)]
Avoid false gethostname_used_without_requesting_gnulib_module_gethostname.

* modules/gethostname (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/unistd.in.h (gethostname): Don't define to
gethostname_used_without_requesting_gnulib_module_gethostname if the
gnulib module 'gethostname' is in use under the same configure.ac.

9 months agoAvoid false error close_used_without_requesting_gnulib_module_close.
Bruno Haible [Wed, 24 Jul 2024 21:35:53 +0000 (23:35 +0200)]
Avoid false error close_used_without_requesting_gnulib_module_close.

Reported by Frédéric at <https://savannah.gnu.org/bugs/?65958>.

* modules/close (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/unistd.in.h (close): Don't define to
close_used_without_requesting_gnulib_module_close if the gnulib module
'close' is in use under the same configure.ac.

9 months agoxstrtod, xstrtold: Don't treat gradual underflow as an error.
Bruno Haible [Wed, 24 Jul 2024 17:46:44 +0000 (19:46 +0200)]
xstrtod, xstrtold: Don't treat gradual underflow as an error.

* lib/xstrtod.c (XSTRTOD): Upon gradual underflow, return true with
errno = 0.
* lib/xstrtod.h (xstrtod, xstrtold): Update specification.
* tests/test-xstrtod.c (main): For gradual underflow, expect ok &&
errno == 0.
* tests/test-xstrtold.c (main): Likewise.

9 months agoDetect UNIX domain sockets supported by recent Windows versions.
Collin Funk [Wed, 24 Jul 2024 04:31:06 +0000 (21:31 -0700)]
Detect UNIX domain sockets supported by recent Windows versions.

* m4/sockpfaf.m4 (gl_SOCKET_FAMILY_UNIX): Check for afunix.h if
winsock2.h is found. Include it in the compile check.

9 months agosys_socket tests: Fix mistake in previous commit.
Collin Funk [Wed, 24 Jul 2024 04:22:16 +0000 (21:22 -0700)]
sys_socket tests: Fix mistake in previous commit.

* modules/sys_socket-tests (configure.ac): Invoke gl_SOCKET_FAMILY_UNIX.

9 months agosys_socket tests: Define macros necessary for tests (regr. 2024-07-22).
Collin Funk [Wed, 24 Jul 2024 02:31:22 +0000 (19:31 -0700)]
sys_socket tests: Define macros necessary for tests (regr. 2024-07-22).

* modules/sys_socket-tests (configure.ac): Invoke gl_SOCKET_FAMILIES.

9 months agosys_socket tests: Improve checks for socklen_t and sa_family_t.
Collin Funk [Wed, 24 Jul 2024 02:00:28 +0000 (19:00 -0700)]
sys_socket tests: Improve checks for socklen_t and sa_family_t.

* modules/sys_socket-tests (Depends-on): Add intprops.
* tests/test-sys_socket.c: Check that socklen_t is at least 32 bits
wide. Check that sa_family_t is unsigned.

9 months agogetopt-posix, getopt-gnu tests: Avoid test failure on mingw.
Bruno Haible [Wed, 24 Jul 2024 00:02:45 +0000 (02:02 +0200)]
getopt-posix, getopt-gnu tests: Avoid test failure on mingw.

* tests/test-getopt.h (test_getopt): Don't special-case mingw.

9 months agoxstrtod, xstrtold: Add documentation.
Bruno Haible [Tue, 23 Jul 2024 18:58:45 +0000 (20:58 +0200)]
xstrtod, xstrtold: Add documentation.

* lib/xstrtod.h (xstrtod, xstrtold): Add comments.
* lib/xstrtod.c (XSTRTOD): Improve comments.

9 months agoxstrtold: Add tests.
Bruno Haible [Tue, 23 Jul 2024 17:11:00 +0000 (19:11 +0200)]
xstrtold: Add tests.

* tests/test-xstrtold.c: New file, based on tests/test-strtold.h.
* modules/xstrtold-tests: New file.

9 months agoxstrtod: Add tests.
Bruno Haible [Tue, 23 Jul 2024 17:10:34 +0000 (19:10 +0200)]
xstrtod: Add tests.

* tests/test-xstrtod.c: New file, based on tests/test-strtod.h.
* modules/xstrtod-tests: New file.

9 months agostrtof, strtod, strtold tests: Strengthen tests.
Bruno Haible [Tue, 23 Jul 2024 18:16:22 +0000 (20:16 +0200)]
strtof, strtod, strtold tests: Strengthen tests.

* tests/test-strtof.h (test_function): Strengthen the flush-to-zero
underflow tests.
* tests/test-strtod.h (test_function): Likewise.
* tests/test-strtold.h (test_function): Likewise.

9 months agodoc: Update for glibc 2.40.
Bruno Haible [Tue, 23 Jul 2024 12:49:18 +0000 (14:49 +0200)]
doc: Update for glibc 2.40.

* doc/posix-headers/utmpx.texi: Update.
* doc/posix-functions/*.texi: Likewise.

9 months agostrtof, strtod, strtold tests: Strengthen tests.
Bruno Haible [Tue, 23 Jul 2024 10:41:12 +0000 (12:41 +0200)]
strtof, strtod, strtold tests: Strengthen tests.

* tests/test-strtof.h (test_function): Add another overflow test.
* tests/test-strtod.h (test_function): Likewise.
* tests/test-strtold.h (test_function): Likewise.

9 months agostrtold: Revisit underflow behaviour.
Bruno Haible [Tue, 23 Jul 2024 10:40:58 +0000 (12:40 +0200)]
strtold: Revisit underflow behaviour.

* doc/posix-functions/strtold.texi: Mention broken mingw 5.0. Mention
that gradual underflow does not count as an error on MSVC.
* tests/test-strtold.h (test_function): Add a gradual underflow test.
Check the sign in case of flush-to-zero underflow.

9 months agostrtod: Revisit underflow behaviour.
Bruno Haible [Tue, 23 Jul 2024 10:40:37 +0000 (12:40 +0200)]
strtod: Revisit underflow behaviour.

* doc/posix-functions/strtod.texi: Mention the macOS bug. Mention that
gradual underflow does not count as an error on Cygwin 2.9 and MSVC.
* m4/strtod.m4 (gl_FUNC_STRTOD): Update comment.
* tests/test-strtod.h (test_function): Add a gradual underflow test.
Check the sign in case of flush-to-zero underflow.

9 months agostrtof: Revisit underflow behaviour.
Bruno Haible [Tue, 23 Jul 2024 10:40:33 +0000 (12:40 +0200)]
strtof: Revisit underflow behaviour.

* doc/posix-functions/strtof.texi: Mention the macOS bug. Mention the
mingw overflow bug. Mention the underflow bugs on Cygwin 2.9 and mingw.
Mention that gradual underflow does not count as an error on Cygwin 2.9,
mingw, MSVC.
* m4/strtof.m4 (gl_FUNC_STRTOF): Test against the mingw overflow bug.
* tests/test-strtof.h (test_function): Add a gradual underflow test.
Check the sign in case of flush-to-zero underflow.

9 months agostrtof, strtod, strtold: Fix underflow behaviour of system function.
Bruno Haible [Tue, 23 Jul 2024 10:40:19 +0000 (12:40 +0200)]
strtof, strtod, strtold: Fix underflow behaviour of system function.

* m4/strtof.m4 (gl_FUNC_STRTOF): Test for strtof's behaviour upon
underflow. Conditionally define STRTOF_HAS_UNDERFLOW_BUG,
STRTOF_HAS_GRADUAL_UNDERFLOW_PROBLEM.
* m4/strtod.m4 (gl_FUNC_STRTOD): Test for strtod's behaviour upon
underflow. Conditionally define STRTOD_HAS_UNDERFLOW_BUG,
STRTOD_HAS_GRADUAL_UNDERFLOW_PROBLEM.
* m4/strtold.m4 (gl_FUNC_STRTOLD): Test for strtold's behaviour upon
gradual underflow. Conditionally define
STRTOLD_HAS_GRADUAL_UNDERFLOW_PROBLEM.
* lib/strtod.c (HAVE_UNDERLYING_STRTOD): Test STRTOF_HAS_UNDERFLOW_BUG,
STRTOD_HAS_UNDERFLOW_BUG.
(HAS_GRADUAL_UNDERFLOW_PROBLEM): New macro.
(SET_ERRNO_UPON_GRADUAL_UNDERFLOW): New macro.
(STRTOD): Use it.

9 months agostrtof: Use the system's strtof() if available.
Bruno Haible [Tue, 23 Jul 2024 10:40:15 +0000 (12:40 +0200)]
strtof: Use the system's strtof() if available.

* m4/strtof.m4 (gl_FUNC_STRTOF): Define HAVE_STRTOF if strtof exists.

9 months agostrtof, strtod, strtold: Set errno upon gradual underflow.
Bruno Haible [Tue, 23 Jul 2024 08:39:28 +0000 (10:39 +0200)]
strtof, strtod, strtold: Set errno upon gradual underflow.

* lib/strtod.c (scale_radix_exp): If the result is a denormalized
number, set errno to ERANGE.

9 months agosys_socket tests: Improve tests for macro definitions.
Collin Funk [Tue, 23 Jul 2024 03:54:17 +0000 (20:54 -0700)]
sys_socket tests: Improve tests for macro definitions.

* modules/sys_socket-tests (Depends-on): Add assert-h.
* tests/test-sys_socket.c (a): Remove variable.
(main): Test that each supported address family is defined to a distinct
value. Test that each constant passed as the second argument of
'shutdown' is defined to a distinct value.

9 months agognulib-tool: Omit the logs of skipped tests from test-suite.log.
Bruno Haible [Mon, 22 Jul 2024 13:05:30 +0000 (15:05 +0200)]
gnulib-tool: Omit the logs of skipped tests from test-suite.log.

* gnulib-tool.sh (func_emit_tests_Makefile_am): Emit an assignment to
IGNORE_SKIPPED_LOGS.
* pygnulib/GLEmiter.py (GLEmiter.tests_Makefile_am): Likewise.

9 months agobootstrap: Avoid failure when gnulib-tool removed gettext.m4.
Bruno Haible [Sun, 21 Jul 2024 12:02:58 +0000 (14:02 +0200)]
bootstrap: Avoid failure when gnulib-tool removed gettext.m4.

* top/bootstrap-funclib.sh (autogen): When gnulib-tool has removed
gettext.m4 but the package needs gettext.m4, repeat the autopoint and
gnulib-tool invocations.
* build-aux/bootstrap: Regenerated.

9 months agostack-trace: Don't use libasan by default.
Bruno Haible [Sat, 20 Jul 2024 23:19:01 +0000 (01:19 +0200)]
stack-trace: Don't use libasan by default.

* m4/stack-trace.m4 (gl_STACK_TRACE_EARLY): Remove libasan as second
choice.

9 months agodoc: Sort the ISO C and POSIX Function Substitutes by header file.
Bruno Haible [Sat, 20 Jul 2024 18:02:14 +0000 (20:02 +0200)]
doc: Sort the ISO C and POSIX Function Substitutes by header file.

* doc/gnulib.texi (Function Substitutes): Add one section per header
file.
* doc/posix-functions/*.texi: Each of these files is now a subsection.

9 months agogetpayload*: Do use glibc's implementation when it works.
Bruno Haible [Sat, 20 Jul 2024 14:38:11 +0000 (16:38 +0200)]
getpayload*: Do use glibc's implementation when it works.

Reported by Andreas K. Huettel <dilfridge@gentoo.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00206.html>.

* m4/getpayload.m4 (gl_FUNC_GETPAYLOADF, gl_FUNC_GETPAYLOAD,
gl_FUNC_GETPAYLOADL): Link the test program with -lm if needed.

9 months agodoc: Reference POSIX for functions that are added in POSIX:2024.
Bruno Haible [Sat, 20 Jul 2024 14:22:50 +0000 (16:22 +0200)]
doc: Reference POSIX for functions that are added in POSIX:2024.

* doc/posix-functions/_Fork.texi etc: Reference POSIX:2024, not the LSB
and not the Austin Group tracker.

9 months agodoc: Update status of functions that are added in POSIX:2024.
Bruno Haible [Sat, 20 Jul 2024 13:34:55 +0000 (15:34 +0200)]
doc: Update status of functions that are added in POSIX:2024.

* doc/posix-functions/_Fork.texi: Moved here from doc/glibc-functions/.
* doc/posix-functions/accept4.texi: Likewise.
* doc/posix-functions/asprintf.texi: Likewise.
* doc/posix-functions/bind_textdomain_codeset.texi: Likewise.
* doc/posix-functions/bindtextdomain.texi: Likewise.
* doc/posix-functions/dcgettext.texi: Likewise.
* doc/posix-functions/dcngettext.texi: Likewise.
* doc/posix-functions/dgettext.texi: Likewise.
* doc/posix-functions/dladdr.texi: Likewise.
* doc/posix-functions/dngettext.texi: Likewise.
* doc/posix-functions/dup3.texi: Likewise.
* doc/posix-functions/ffsl.texi: Likewise.
* doc/posix-functions/ffsll.texi: Likewise.
* doc/posix-functions/getentropy.texi: Likewise.
* doc/posix-functions/getresgid.texi: Likewise.
* doc/posix-functions/getresuid.texi: Likewise.
* doc/posix-functions/gettext.texi: Likewise.
* doc/posix-functions/in6addr_any.texi: Likewise.
* doc/posix-functions/in6addr_loopback.texi: Likewise.
* doc/posix-functions/memmem.texi: Likewise.
* doc/posix-functions/mkostemp.texi: Likewise.
* doc/posix-functions/ngettext.texi: Likewise.
* doc/posix-functions/pipe2.texi: Likewise.
* doc/posix-functions/ppoll.texi: Likewise.
* doc/posix-functions/pthread_cond_clockwait.texi: Likewise.
* doc/posix-functions/pthread_mutex_clocklock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_clockrdlock.texi: Likewise.
* doc/posix-functions/pthread_rwlock_clockwrlock.texi: Likewise.
* doc/posix-functions/ptsname_r.texi: Likewise.
* doc/posix-functions/qsort_r.texi: Likewise.
* doc/posix-functions/secure_getenv.texi: Likewise.
* doc/posix-functions/sem_clockwait.texi: Likewise.
* doc/posix-functions/setresgid.texi: Likewise.
* doc/posix-functions/setresuid.texi: Likewise.
* doc/posix-functions/textdomain.texi: Likewise.
* doc/posix-functions/timespec_get.texi: Likewise.
* doc/posix-functions/vasprintf.texi: Likewise.
* doc/posix-functions/reallocarray.texi: Likewise. Improve text.
* doc/gnulib.texi (Function Substitutes): Include them here.
(Glibc Function Substitutes): Don't include them here.
(Glibc libintl.h): Remove section.
(Glibc poll.h): Remove section.
(Glibc semaphore.h): Remove section.

9 months agodoc: Reference POSIX:2024 instead of POSIX:2018.
Bruno Haible [Sat, 20 Jul 2024 11:50:52 +0000 (13:50 +0200)]
doc: Reference POSIX:2024 instead of POSIX:2018.

* doc/*.texi: Change URL to POSIX.
* doc/posix-headers/*.texi: Likewise.
* doc/posix-functions/*.texi: Likewise.

9 months agodoc: Update status of functions that are removed from POSIX:2024.
Bruno Haible [Sat, 20 Jul 2024 11:44:43 +0000 (13:44 +0200)]
doc: Update status of functions that are removed from POSIX:2024.

* doc/pastposix-functions/_longjmp.texi: Moved here
fromdoc/posix-functions/.
* doc/pastposix-functions/_setjmp.texi: Likewise.
* doc/pastposix-functions/_tolower.texi: Likewise.
* doc/pastposix-functions/_toupper.texi: Likewise.
* doc/pastposix-functions/fattach.texi: Likewise.
* doc/pastposix-functions/fdetach.texi: Likewise.
* doc/pastposix-functions/ftw.texi: Likewise.
* doc/pastposix-functions/getitimer.texi: Likewise.
* doc/pastposix-functions/getmsg.texi: Likewise.
* doc/pastposix-functions/getpmsg.texi: Likewise.
* doc/pastposix-functions/gets.texi: Likewise.
* doc/pastposix-functions/gettimeofday.texi: Likewise.
* doc/pastposix-functions/ioctl.texi: Likewise.
* doc/pastposix-functions/isascii.texi: Likewise.
* doc/pastposix-functions/isastream.texi: Likewise.
* doc/pastposix-functions/posix_trace_*.texi: Likewise.
* doc/pastposix-functions/pthread_getconcurrency.texi: Likewise.
* doc/pastposix-functions/pthread_setconcurrency.texi: Likewise.
* doc/pastposix-functions/putmsg.texi: Likewise.
* doc/pastposix-functions/putpmsg.texi: Likewise.
* doc/pastposix-functions/setitimer.texi: Likewise.
* doc/pastposix-functions/setpgrp.texi: Likewise.
* doc/pastposix-functions/sighold.texi: Likewise.
* doc/pastposix-functions/sigignore.texi: Likewise.
* doc/pastposix-functions/siginterrupt.texi: Likewise.
* doc/pastposix-functions/sigpause.texi: Likewise.
* doc/pastposix-functions/sigrelse.texi: Likewise.
* doc/pastposix-functions/sigset.texi: Likewise.
* doc/pastposix-functions/tempnam.texi: Likewise.
* doc/pastposix-functions/toascii.texi: Likewise.
* doc/pastposix-functions/ulimit.texi: Likewise.
* doc/pastposix-functions/utime.texi: Likewise.
* doc/gnulib.texi (Function Substitutes): Don't include them here.
(Legacy Function Substitutes): Include them here.