summaryrefslogtreecommitdiff
path: root/doc
Commit message (Collapse)AuthorAgeFilesLines
...
* doc: Fix placement of memset_explicit node.Bruno Haible2023-03-281-1/+1
| | | | | * doc/posix-functions/memset_explicit.texi: Define a section, not a subsection.
* doc: Update regarding linear string search.Bruno Haible2023-03-283-6/+5
| | | | | | * doc/glibc-functions/memmem.texi: Update platforms list. * doc/posix-functions/strstr.texi: Likewise. * doc/glibc-functions/strcasestr.texi: Likewise.
* wcsstr: Ensure worst-case linear execution time.Bruno Haible2023-03-272-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | * lib/wchar.in.h (wcsstr): Consider REPLACE_WCSSTR. * lib/wcs-two-way.h: New file, based on lib/str-two-way.h. * lib/wcsstr-impl.h: If requested, use the two-way algorithm. New code based on lib/strstr.c. * m4/wcsstr.m4 (gl_FUNC_WCSSTR_SIMPLE): Renamed from gl_FUNC_WCSSTR. (gl_FUNC_WCSSTR): New macro, based on gl_FUNC_STRSTR in m4/strstr.m4. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WCSSTR. * modules/wchar (Makefile.am): Substitute REPLACE_WCSSTR. * modules/wcsstr-simple: New file, based on modules/wcsstr. * modules/wcsstr (Description): Document that this module now provides an efficient implementation. (Files): Add lib/wcs-two-way.h. (Depends-on): Depend on wcsstr-simple and the dependencies of the two-way implementation. (configure.ac): Use AC_LIBOBJ instead of a conditional. Don't invoke gl_WCHAR_MODULE_INDICATOR. (Makefile.am): Don't augment lib_SOURCES. * tests/test-wcsstr.c: New file, based on tests/test-strstr.c. * modules/wcsstr-tests: New file, based on modules/strstr-tests. * doc/posix-functions/wcsstr.texi: Mention the worst-case complexity. Mention the new 'wcsstr-simple' module. * doc/posix-functions/strstr.texi: Fix typo.
* stdlib: ISO C 23: Document issue with once_flag and call_once.Bruno Haible2023-03-251-0/+6
| | | | * doc/posix-headers/stdlib.texi: Document issue and workaround.
* call_once: New module, separate from mtx.Bruno Haible2023-03-251-1/+1
| | | | | | | | | | | | | | | | | | | * lib/threads.in.h (call_once): Declare as part of module 'call_once', not module 'mtx'. * lib/call_once.c: New file, extracted from lib/mtx.c. * lib/mtx.c (call_once): Remove function. * m4/threads_h.m4 (gl_THREADS_H_REQUIRE_DEFAULTS): Inititalize GNULIB_CALL_ONCE. * modules/threads-h (Makefile.am): Substitute GNULIB_CALL_ONCE. * modules/call_once: New file, based on modules/mtx. * modules/threads (Depends-on): Add call_once. * tests/test-threads-c++.cc: Update accordingly. * modules/call_once-tests: New file, based on modules/mtx-tests. * modules/mtx-tests (Files): Remove tests/test-call_once.c. (Makefile.am): Don't compile test-call_once. * doc/posix-functions/call_once.texi: Document that the relevant module is now 'call_once'. * NEWS: Mention the change.
* *printf-posix: ISO C 23: Support size specifiers 'wN' and 'wfN'.Bruno Haible2023-03-2416-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/printf-args.h: Include <stdint.h>. (arg_type): Add TYPE_[U]INT8_T, ..., TYPE_[U]INT_FAST64_T and TYPE_COUNT_INT8_T_POINTER, ..., TYPE_COUNT_INT_FAST64_T_POINTER. (argument): Add the union members a_[u]int8_t, ..., a_[u]int_fast64_t and a_count_int8_t_pointer, ..., a_count_int_fast64_t_pointer. * lib/printf-args.c: Include <limits.h>. (PRINTF_FETCHARGS): Handle TYPE_[U]INT8_T, ..., TYPE_[U]INT_FAST64_T and TYPE_COUNT_INT8_T_POINTER, ..., TYPE_COUNT_INT_FAST64_T_POINTER. * lib/printf-parse.c (PRINTF_PARSE): Accept only one size specifier, not a sequence of size specifiers. Accept "wN" and "wfN", where N = 8, 16, 32, 64. * lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Handle the new TYPE_* values as well. * m4/printf.m4 (gl_PRINTF_SIZES_C23): New macro. * m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_IS_POSIX): Require gl_PRINTF_SIZES_C23. Test gl_cv_func_printf_sizes_c23. * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): Likewise. * m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): Likewise. * m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX): Likewise. * m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): Likewise. * m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): Likewise. * m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): Likewise. * m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): Likewise. * m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): Likewise. * m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): Likewise. * m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): Likewise. * tests/test-vasnprintf-posix.c (test_function): Add tests for size specifiers with %d, %u, %b, %o, %x. * tests/test-snprintf-posix.h (test_function): Likewise. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnwprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * modules/vasnprintf (Depends-on): Add limits-h. * modules/vasnwprintf (Depends-on): Add limits-h. * modules/c-vasnprintf (Depends-on): Add limits-h, stdint. * modules/unistdio/u-printf-args (Depends-on): Add stdint, limits-h. * doc/posix-functions/dprintf.texi: Mention the ISO C 23 size specifiers. * doc/posix-functions/fprintf.texi: Likewise. * doc/posix-functions/fwprintf.texi: Likewise. * doc/posix-functions/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.texi: Likewise. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vdprintf.texi: Likewise. * doc/posix-functions/vfprintf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vprintf.texi: Likewise. * doc/posix-functions/vsnprintf.texi: Likewise. * doc/posix-functions/vsprintf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise.
* obstack-printf-gnu: New module.Bruno Haible2023-03-242-6/+20
| | | | | | | | | | | | * m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_IS_POSIX): New macro, extracted from gl_FUNC_OBSTACK_PRINTF_POSIX. (gl_FUNC_OBSTACK_PRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/obstack-printf-gnu.m4: New file, based on m4/obstack-printf-posix.m4. * modules/obstack-printf-gnu: New file, based on modules/vasnprintf-gnu. * doc/glibc-functions/obstack_printf.texi: Mention the new module. * doc/glibc-functions/obstack_vprintf.texi: Likewise.
* dprintf-gnu: New module.Bruno Haible2023-03-241-3/+10
| | | | | | | | | | * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_DPRINTF_POSIX. (gl_FUNC_DPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/dprintf-gnu.m4: New file, based on m4/dprintf-posix.m4. * modules/dprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/dprintf.texi: Mention the new module.
* vdprintf-gnu: New module.Bruno Haible2023-03-241-3/+10
| | | | | | | | | | * m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VDPRINTF_POSIX. (gl_FUNC_VDPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vdprintf-gnu.m4: New file, based on m4/vdprintf-posix.m4. * modules/vdprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vdprintf.texi: Mention the new module.
* printf-gnu: New module.Bruno Haible2023-03-241-4/+11
| | | | | | | | | | | | * m4/printf-posix.m4: Renamed from m4/printf-posix-rpl.m4. (gl_FUNC_PRINTF_IS_POSIX): New macro. (gl_FUNC_PRINTF_POSIX): Require it. Don't require gl_FUNC_VFPRINTF_POSIX. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS and gl_REPLACE_VASNPRINTF. * m4/printf-gnu.m4: New file, based on m4/fprintf-posix.m4. * modules/printf-posix (Files): Update. * modules/printf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/printf.texi: Mention the new module.
* vprintf-gnu: New module.Bruno Haible2023-03-241-4/+11
| | | | | | | | | | * m4/vprintf-posix.m4 (gl_FUNC_VPRINTF_IS_POSIX): New macro. (gl_FUNC_VPRINTF_POSIX): Require it. Don't require gl_FUNC_VFPRINTF_POSIX. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS and gl_REPLACE_VASNPRINTF. * m4/vprintf-gnu.m4: New file, based on m4/vfprintf-posix.m4. * modules/vprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vprintf.texi: Mention the new module.
* fprintf-gnu: New module.Bruno Haible2023-03-241-4/+11
| | | | | | | | | | * m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_FPRINTF_POSIX. (gl_FUNC_FPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/fprintf-gnu.m4: New file, based on m4/fprintf-posix.m4. * modules/fprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/fprintf.texi: Mention the new module.
* vfprintf-gnu: New module.Bruno Haible2023-03-241-4/+11
| | | | | | | | | | * m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VFPRINTF_POSIX. (gl_FUNC_VFPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vfprintf-gnu.m4: New file, based on m4/vfprintf-posix.m4. * modules/vfprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vfprintf.texi: Mention the new module.
* vasprintf-gnu: New module.Bruno Haible2023-03-242-6/+20
| | | | | | | | | | | * m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VASPRINTF_POSIX. (gl_FUNC_VASPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vasprintf-gnu.m4: New file, based on m4/vasprintf-posix.m4. * modules/vasprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/glibc-functions/vasprintf.texi: Mention the new module. * doc/glibc-functions/asprintf.texi: Likewise.
* sprintf-gnu: New module.Bruno Haible2023-03-241-2/+9
| | | | | | | | | | * m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_SPRINTF_POSIX. (gl_FUNC_SPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/sprintf-gnu.m4: New file, based on m4/sprintf-posix.m4. * modules/sprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/sprintf.texi: Mention the new module.
* vsprintf-gnu: New module.Bruno Haible2023-03-241-2/+9
| | | | | | | | | | * m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VSPRINTF_POSIX. (gl_FUNC_VSPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vsprintf-gnu.m4: New file, based on m4/vsprintf-posix.m4. * modules/vsprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vsprintf.texi: Mention the new module.
* snprintf-gnu: New module.Bruno Haible2023-03-241-3/+10
| | | | | | | | | | * m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_SNPRINTF_POSIX. (gl_FUNC_SNPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/snprintf-gnu.m4: New file, based on m4/snprintf-posix.m4. * modules/snprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/snprintf.texi: Mention the new module.
* vsnprintf-gnu: New module.Bruno Haible2023-03-241-3/+10
| | | | | | | | | | * m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_IS_POSIX): New macro, extracted from gl_FUNC_VSNPRINTF_POSIX. (gl_FUNC_VSNPRINTF_POSIX): Require it. Invoke gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS. * m4/vsnprintf-gnu.m4: New file, based on m4/vsnprintf-posix.m4. * modules/vsnprintf-gnu: New file, based on modules/vasnprintf-gnu. * doc/posix-functions/vsnprintf.texi: Mention the new module.
* vasnwprintf: Fix test failures on FreeBSD, NetBSD, AIX, mingw.Bruno Haible2023-03-221-0/+7
| | | | | | | | | | | | | * m4/printf.m4 (gl_SWPRINTF_WORKS): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke it and define HAVE_WORKING_SWPRINTF accordingly. * lib/vasnprintf.c: Together with HAVE_SWPRINTF, test also HAVE_WORKING_SWPRINTF. (VASNPRINTF): If WIDE_CHAR_VERSION && !DCHAR_IS_TCHAR, don't pass a wchar_t[] to snprintf. Add a workaround against mingw's snwprintf function. * doc/posix-functions/swprintf.texi: Document the null wide character bug.
* *printf-posix: Work around bug with %lc of 0 on many platforms.Bruno Haible2023-03-2114-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/vasnprintf.c (local_wctomb): Define also for NEED_PRINTF_DIRECTIVE_LC. (VASNPRINTF): Implement %lc handling ourselves if NEED_PRINTF_DIRECTIVE_LC. * m4/printf.m4 (gl_PRINTF_DIRECTIVE_LC): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_DIRECTIVE_LC): New macro. (gl_PREREQ_VASNPRINTF_WITH_EXTRAS): Invoke it. * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Require gl_PRINTF_DIRECTIVE_LC and test its result. Invoke gl_PREREQ_VASNPRINTF_DIRECTIVE_LC. * m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_POSIX): Likewise. * m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_POSIX): Likewise. * m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_POSIX): Likewise. * m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_POSIX): Likewise. * m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_POSIX): Likewise. * m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_POSIX): Likewise. * m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise. * m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_POSIX): Likewise. * m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_POSIX): Likewise. * m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_POSIX): Likewise. * tests/test-snprintf-posix.h (test_function): Add more tests for the %c and %lc directives. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * doc/glibc-functions/asprintf.texi: Mention the %lc 0 bug. * doc/glibc-functions/obstack_printf.texi: Likewise. * doc/glibc-functions/obstack_vprintf.texi: Likewise. * doc/glibc-functions/vasprintf.texi: Likewise. * doc/posix-functions/dprintf.texi: Likewise. * doc/posix-functions/fprintf.texi: Likewise. * doc/posix-functions/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.texi: Likewise. * doc/posix-functions/vdprintf.texi: Likewise. * doc/posix-functions/vfprintf.texi: Likewise. * doc/posix-functions/vprintf.texi: Likewise. * doc/posix-functions/vsnprintf.texi: Likewise. * doc/posix-functions/vsprintf.texi: Likewise.
* vasnwprintf: Fix test failures on musl libc.Bruno Haible2023-03-201-0/+10
| | | | | | | | | | * m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke gl_MUSL_LIBC. * lib/vasnprintf.c (VASNPRINTF): On musl libc, when WIDE_CHAR_VERSION, - force pad_ourselves to be 1, - don't use %n. Fix zero-padding when the result starts with a prefix "0x" or "0b". * modules/vasnwprintf (Files): Add musl.m4. * doc/posix-functions/swprintf.texi: Mention two musl libc bugs.
* *printf-posix: ISO C 23: Add %b directive for binary output of integers.Bruno Haible2023-03-1720-24/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/printf-parse.c (PRINTF_PARSE): Recognize the 'b' directive. * lib/printf-parse.h: Update comment. * lib/wprintf-parse.h: Likewise. * lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Add support for the 'b' directive. * m4/printf.m4 (gl_PRINTF_DIRECTIVE_B): New macro. * m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_DIRECTIVE_B): New macro. (gl_PREREQ_VASNPRINTF_WITH_EXTRAS): Invoke it. * m4/vasnwprintf-posix.m4 (gl_FUNC_VASNWPRINTF_POSIX): Invoke gl_PREREQ_VASNPRINTF_DIRECTIVE_B. * m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Require gl_PRINTF_DIRECTIVE_B and test its result. Invoke gl_PREREQ_VASNPRINTF_DIRECTIVE_B. * m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_POSIX): Likewise. * m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_POSIX): Likewise. * m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_POSIX): Likewise. * m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_POSIX): Likewise. * m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_POSIX): Likewise. * m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_POSIX): Likewise. * m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise. * m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_POSIX): Likewise. * m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_POSIX): Likewise. * m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_POSIX): Likewise. * tests/test-snprintf-posix.h (test_function): Add some tests of the %b directive. * tests/test-sprintf-posix.h (test_function): Likewise. * tests/test-vasnprintf-posix.c (test_function): Likewise. * tests/test-vasnwprintf-posix.c (test_function): Likewise. * tests/test-vasprintf-posix.c (test_function): Likewise. * doc/glibc-functions/asprintf.texi: Mention the 'b' directive. * doc/glibc-functions/obstack_printf.texi: Likewise. * doc/glibc-functions/obstack_vprintf.texi: Likewise. * doc/glibc-functions/vasprintf.texi: Likewise. * doc/posix-functions/dprintf.texi: Likewise. * doc/posix-functions/fprintf.texi: Likewise. * doc/posix-functions/fwprintf.texi: Likewise. * doc/posix-functions/printf.texi: Likewise. * doc/posix-functions/snprintf.texi: Likewise. * doc/posix-functions/sprintf.texi: Likewise. * doc/posix-functions/swprintf.texi: Likewise. * doc/posix-functions/vdprintf.texi: Likewise. * doc/posix-functions/vfprintf.texi: Likewise. * doc/posix-functions/vfwprintf.texi: Likewise. * doc/posix-functions/vprintf.texi: Likewise. * doc/posix-functions/vsnprintf.texi: Likewise. * doc/posix-functions/vsprintf.texi: Likewise. * doc/posix-functions/vswprintf.texi: Likewise. * doc/posix-functions/vwprintf.texi: Likewise. * doc/posix-functions/wprintf.texi: Likewise.
* time: Fix test failure on AIX 7.2.Bruno Haible2023-03-171-4/+4
| | | | | * m4/time.m4 (gl_FUNC_TIME): Guess that it does not work on AIX. * doc/posix-functions/time.texi: Mention the bug on AIX.
* time: Fix test failure on native Windows.Bruno Haible2023-03-171-4/+5
| | | | | | | * m4/time.m4 (gl_FUNC_TIME): Guess that it does not work on native Windows. * modules/time (Depends-on): Add gettimeofday. * doc/posix-functions/time.texi: Mention the bug on Windows.
* strtol, strtoll, strtoul, strtoull: Make ISO C 23 compliant.Bruno Haible2023-03-164-0/+12
| | | | | | | | | | | | | | | | | | | | * lib/strtol.c (INTERNAL (strtol)): Treat 'b' and base 2 like 'x' and base 16. Based on glibc commit 64924422a99690d147a166b4de3103f3bf3eaf6c by Joseph Myers. * m4/strtol.m4 (gl_FUNC_STRTOL): Test also whether parsing binary integers works. Update cross-compilation guesses. * m4/strtoll.m4 (gl_FUNC_STRTOLL): Likewise. * m4/strtoul.m4 (gl_FUNC_STRTOUL): Likewise. * m4/strtoull.m4 (gl_FUNC_STRTOULL): Likewise. * tests/test-strtol.c (main): Add tests of parsing binary integers. * tests/test-strtoll.c (main): Likewise. * tests/test-strtoul.c (main): Likewise. * tests/test-strtoull.c (main): Likewise. * doc/posix-functions/strtol.texi: Mention the problem with parsing binary integers. * doc/posix-functions/strtoll.texi: Likewise. * doc/posix-functions/strtoul.texi: Likewise. * doc/posix-functions/strtoull.texi: Likewise.
* timegm: Document under ISO C and POSIX substitutes.Bruno Haible2023-03-162-3/+3
| | | | | | * doc/posix-functions/timegm.texi: Renamed from doc/glibc-functions/timegm.texi. * doc/gnulib.texi (Function Substitutes): Include timegm.texi here... (Glibc time.h): ... not here.
* stddef: Define 'unreachable', for ISO C 23 compliance.Bruno Haible2023-03-161-0/+4
| | | | | | | | | | | | * lib/verify.h (_GL_HAS_BUILTIN_UNREACHABLE): Don't define if already defined. * lib/stddef.in.h (_GL_HAS_BUILTIN_UNREACHABLE, unreachable): New macros. (abort): Declare if needed for unreachable. * m4/stddef_h.m4 (gl_STDDEF_H): Test for unreachable. * tests/test-stddef.c (test_unreachable_optimization, test_unreachable_noreturn): New functions, based on tests/test-verify.c. * doc/posix-headers/stddef.texi: Mention unreachable.
* time: New module.Bruno Haible2023-03-081-1/+9
| | | | | | | | | | | | | | * lib/time.in.h (time): New declaration. * lib/time.c: New file. * m4/time_h.m4 (gl_TIME_H_REQUIRE_DEFAULTS): Initialize GNULIB_TIME. (gl_TIME_H_DEFAULTS): Initialize REPLACE_TIME. * m4/time.m4: New file. * modules/time-h (Makefile.am): Substitute GNULIB_TIME, REPLACE_TIME. * modules/time: New file. * tests/test-time-h-c++.cc: Check the signature of GNULIB_NAMESPACE::time. * doc/posix-functions/time.texi: Mention the glibc problem and the 'time' module.
* time-h: Renamed from time.Bruno Haible2023-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/time-h: Renamed from modules/time. * tests/test-time-h.c: Renamed from tests/test-time.c. * modules/time-h-tests: Renamed from modules/time-tests. Update. * tests/test-time-h-c++.cc: Renamed from tests/test-time-c++.cc. * tests/test-time-h-c++2.cc: Renamed from tests/test-time-c++2.cc. * modules/time-h-c++-tests: Renamed from modules/time-c++-tests. Update. * modules/cond (Depends-on): Update. * modules/ctime (Depends-on): Likewise. * modules/localtime (Depends-on): Likewise. * modules/mktime (Depends-on): Likewise. * modules/nanosleep (Depends-on): Likewise. * modules/parse-datetime (Depends-on): Likewise. * modules/posixcheck (Depends-on): Likewise. * modules/pthread-h (Depends-on): Likewise. * modules/stat-time (Depends-on): Likewise. * modules/stat-time-tests (Depends-on): Likewise. * modules/strftime-fixes (Depends-on): Likewise. * modules/strptime (Depends-on): Likewise. * modules/sys_stat (Depends-on): Likewise. * modules/tempname (Depends-on): Likewise. * modules/threads-h (Depends-on): Likewise. * modules/time_r (Depends-on): Likewise. * modules/time_rz (Depends-on): Likewise. * modules/timegm (Depends-on): Likewise. * modules/timespec (Depends-on): Likewise. * modules/timespec_get (Depends-on): Likewise. * modules/timespec_getres (Depends-on): Likewise. * modules/tzset (Depends-on): Likewise. * modules/usleep-tests (Depends-on): Likewise. * modules/utime (Depends-on): Likewise. * modules/utimecmp (Depends-on): Likewise. * modules/utimens (Depends-on): Likewise. * modules/windows-cond (Depends-on): Likewise. * modules/windows-timedmutex (Depends-on): Likewise. * modules/windows-timedrecmutex (Depends-on): Likewise. * modules/windows-timedrwlock (Depends-on): Likewise. * modules/xnanosleep (Depends-on): Likewise. * doc/posix-headers/time.texi: Update. * NEWS: Mention the change.
* stdio: suppress macOS 13 sprintf warningsPaul Eggert2023-03-052-6/+6
| | | | | | | | * lib/stdio.in.h (_POSIX_C_SOURCE, _GL_DEFINED__POSIX_C_SOURCE): Suppress deprecation warnings for sprintf and vsprintf that were introduced in macOS 13. These are not useful for Gnulib itself, and are more likely than not to be merely an annoyance for Gnulib-using code.
* Remove unused documentation file.Bruno Haible2023-03-051-16/+0
| | | | * doc/glibc-functions/timespec_getres.texi: Remove file.
* lseek: avoid SEEK_HOLE bugs in FreeBSD, macOSPaul Eggert2023-02-231-0/+5
| | | | | | | | | | | | | This attempts to fix <https://bugs.gnu.org/61386>, a bug in GNU cp caused by a serious data corruption bug in FreeBSD and macOS. * doc/posix-functions/lseek.texi: Mention the bug. * lib/unistd.in.h (SEEK_DATA, SEEK_HOLE): Undef in macOS < 13 and FreeBSD < 14. FreeBSD fixed the bug sometime during FreeBSD 13 <https://bugs.freebsd.org/256205>, so the "FreeBSD < 14" is conservative. It’s unknown when Apple will fix macOS so use macOS "9999" as a placeholder. * m4/lseek.m4 (gl_FUNC_LSEEK): Replace lseek if on one of the above platforms.
* nullptr: work around Apple clang 14 issuePaul Eggert2023-02-091-3/+4
| | | | | | | | | Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2023-02/msg00098.html * doc/gnulib.texi (nullptr): Document limitations better. * m4/nullptr.m4 (gl_NULLPTR): Check for incompatibility of macOS clang 14.0.0 (clang-1400.0.29.202), where <stddef.h> defines a non-working nullptr macro.
* limits-h: Work around a clang 15 bug.Bruno Haible2023-02-091-0/+3
| | | | | * m4/limits-h.m4 (gl_LIMITS_H): Test also for BOOL_MAX. * doc/posix-headers/limits.texi: Mention the clang bug.
* nullptr: rename from c-nullptrPaul Eggert2023-02-071-5/+6
| | | | | | | | | | * NEWS, doc/gnulib.texi: Mention this. * m4/nullptr.m4: Rename from m4/c-nullptr.m4. (gl_NULLPTR): Rename from gl_C_NULLPTR. * modules/nullptr: Rename from modules/nullptr. * modules/nullptr-c++-tests: Rename from modules/c-nullptr-c++-tests. * modules/nullptr-tests: Rename from modules/c-nullptr-tests. All uses changed.
* c-nullptr: new modulePaul Eggert2023-02-052-0/+48
| | | | | | * doc/gnulib.texi (nullptr): New section. * doc/posix-headers/stddef.texi: Document lack of nullptr_t. * m4/c-nullptr.m4, modules/c-nullptr: New files.
* doc: Update regarding AIX.Bruno Haible2023-02-041-1/+1
| | | | * doc/glibc-headers/getopt.texi: Update.
* doc: Update regarding NetBSD.Bruno Haible2023-02-042-2/+5
| | | | | * doc/posix-functions/sigprocmask.texi: Mention a NetBSD 9.0 bug. * doc/posix-functions/pthread_sigmask.texi: Likewise.
* doc: Update list of target platforms.Bruno Haible2023-01-221-21/+27
| | | | | | | * doc/gnulib-intro.texi (Supported Platforms): Mark musl libc, Android, and MSVC as "occasionally tested". Update the version numbers of some OSes. Combine paragraphs regarding mingw and MSVC. (Formerly Supported Platforms): Mark AIX 5, 6 as "formerly supported".
* login_tty: Ensure declaration in <utmp.h>.Bruno Haible2023-01-213-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/test-utmp-c++.cc: New file. * modules/utmp-c++-tests: New file. * tests/test-utmp.c: New file. * modules/utmp-tests: New file. * lib/login_tty.c: Include <utmp.h>. * m4/login_tty.m4: New file. (gl_FUNC_LOGIN_TTY): Moved here from m4/pty.m4. Set HAVE_LOGIN_TTY. * m4/pty.m4 (gl_FUNC_LOGIN_TTY): Moved to m4/login_tty.m4. * modules/login_tty (Files): Add m4/login_tty.m4. (Depends-on): Add utmp. Remove pty. Update condition. (configure.ac): Update condition. Invoke gl_UTMP_MODULE_INDICATOR instead of gl_PTY_MODULE_INDICATOR. (Include): List <utmp.h>. * doc/glibc-functions/login_tty.texi: Mark the include file diversity as fixed. * tests/test-login_tty.c: Include <utmp.h>. Don't declare login_tty here. * lib/utmp.in.h: New file. * m4/utmp_h.m4: New file. * modules/utmp: New file. * doc/glibc-headers/utmp.texi: New file. * doc/gnulib.texi (Glibc Header File Substitutes): Include it.
* autoupdateKarl Berry2023-01-214-445/+445
|
* fts: Document this module.Bruno Haible2023-01-196-24/+24
| | | | | | | | | * doc/glibc-headers/fts.texi: Mention the 'fts' module. * doc/glibc-functions/fts_children.texi: Likewise. * doc/glibc-functions/fts_close.texi: Likewise. * doc/glibc-functions/fts_open.texi: Likewise. * doc/glibc-functions/fts_read.texi: Likewise. * doc/glibc-functions/fts_set.texi: Likewise.
* mbrtowc, mbrtoc32 tests: Avoid test failure on Android ≥ 5.0.Bruno Haible2023-01-161-1/+7
| | | | | | | * tests/test-mbrtowc.c (main): On Android 5.0 or newer, when testing the "C" locale, verify that the encoding is UTF-8. * tests/test-mbrtoc32.c (main): Likewise. * doc/posix-functions/setlocale.texi: Mention the Android problems.
* alignasof: new modulePaul Eggert2023-01-152-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | This splits off support for the C23 keywords alignas and alignof, from the now-deprecated stdalign module. The latter now merely provides C11 support. * MODULES.html.sh, NEWS, doc/gnulib.texi: * doc/posix-headers/stdalign.texi: Document the change. * lib/stdalign.in.h: Remove most of the definitions (which are now supplied by the alignasof module), leaving only __alignas_is_defined and __alignof_is_defined. * modules/alignasof, modules/alignasof-tests: New files. * m4/stdalign.m4 (gl_ALIGNASOF): New macro, with most of the contents of the old gl_STDALIGN_H. Do not define __alignas_is_defined or __alignof_is_defined. (gl_STDALIGN_H): Rely on gl_ALIGNASOF for most of the work. * modules/alignalloc, modules/alignof, modules/argp: * modules/crypto/md4-buffer, modules/crypto/md5-buffer: * modules/crypto/sha1-buffer, modules/crypto/sha256-buffer: * modules/crypto/sha512-buffer, modules/crypto/sm3-buffer: * modules/fts, modules/rawmemchr, modules/relocatable-prog-wrapper: * modules/stddef-tests, modules/sys_socket: Depend on alignasof, not stdalign. * modules/stdalign: Deprecate. Depend on alignasof. * modules/stdalign-tests: Move most contents to the new module alignasof-tests, and depend on that.
* error: Work around an Android problem.Bruno Haible2023-01-122-1/+5
| | | | | | | | | | | | | | | | * lib/error.in.h: Renamed from lib/error.h. (_GL_ATTRIBUTE_SPEC_PRINTF_ERROR): New macro. (error): Consider HAVE_ERROR and REPLACE_ERROR. (error_at_line): Consider HAVE_ERROR_AT_LINE and REPLACE_ERROR_AT_LINE. * m4/error_h.m4: New file, partially based on m4/error.m4. * m4/error.m4 (gl_ERROR): Remove the test for error_at_line. * modules/error-h: New file. * modules/error (Files): Remove lib/error.h. (Depends-on): Add error-h. Update conditions. (configure.ac): Require gl_ERROR_H. Update condition. * doc/glibc-headers/error.texi: Mention the 'error-h' module. * doc/glibc-functions/error.texi: Mention the Android problem. * config/srclist.txt: Add comment regarding error.h.
* perror: Fix "perror clobbers strerror's buffer" problem on Android.Bruno Haible2023-01-111-1/+1
| | | | | * m4/perror.m4 (gl_FUNC_PERROR): Set REPLACE_PERROR to 1 on Android. * doc/posix-functions/perror.texi: Mention the Android problem.
* getpass: Fix compilation error on Android.Bruno Haible2023-01-051-0/+4
| | | | | * m4/getpass.m4 (gl_FUNC_GETPASS): Define NO_INLINE_GETPASS. * doc/glibc-functions/getpass.texi: Mention the Android problem.
* Recognize functions added in future versions of Android.Bruno Haible2023-01-054-4/+4
| | | | | | | | | | | | | | | | | | | * m4/gnulib-common.m4 (gl_CHECK_FUNCS_ANDROID): New macro. * m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Use gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. * m4/freading.m4 (gl_FUNC_FREADING): Likewise. * m4/fseterr.m4 (gl_FUNC_FSETERR): Likewise. * m4/fwriting.m4 (gl_FUNC_FWRITING): Likewise. * m4/getentropy.m4 (gl_FUNC_GETENTROPY): Likewise. * m4/getlogin_r.m4 (gl_CHECK_FUNCS_ANDROID): Likewise. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Likewise. * m4/glob.m4 (gl_PREREQ_GLOB): Likewise. * m4/spawn_h.m4 (gl_HAVE_POSIX_SPAWN): Likewise. * doc/glibc-functions/getentropy.texi: Mark function as existing in Android 9.0. * doc/glibc-functions/getrandom.texi: Likewise. * doc/posix-functions/pthread_attr_getinheritsched.texi: Likewise. * doc/posix-functions/pthread_attr_setinheritsched.texi: Likewise.
* doc: Update regarding Android.Bruno Haible2023-01-047-4/+20
| | | | | | | | | | * doc/glibc-functions/getdtablesize.texi: Update Android information. * doc/glibc-functions/wait3.texi: Likewise. * doc/pastposix-functions/ftime.texi: Likewise. * doc/pastposix-functions/index.texi: Likewise. * doc/pastposix-functions/pthread_attr_getstackaddr.texi: Likewise. * doc/pastposix-functions/pthread_attr_setstackaddr.texi: Likewise. * doc/pastposix-functions/wcswcs.texi: Likewise.
* ffsl, ffsll: Fix compilation error on Android.Bruno Haible2023-01-032-2/+8
| | | | | | | | | * lib/string.in.h: On Android as well, include <strings.h>. * m4/ffsl.m4 (gl_FUNC_FFSL): Use a specific link test instead of AC_CHECK_FUNCS_ONCE. * m4/ffsll.m4 (gl_FUNC_FFSLL): Likewise. * doc/glibc-functions/ffsl.texi: Mention Android problems. * doc/glibc-functions/ffsll.texi: Likewise.