summaryrefslogtreecommitdiff
path: root/m4
Commit message (Collapse)AuthorAgeFilesLines
...
* environ: Fix wrong autoconf test result in C++ mode.Bruno Haible2021-06-281-2/+3
| | | | | * m4/environ.m4 (gt_CHECK_VAR_DECL): Use a typedef'ed type, not an anonymous type.
* sigsegv, sigsegv-tests: Assign my contributions to the FSF.Eric Blake2021-06-211-1/+0
| | | | | | | | | | Following Bruno's lead, I'm also happy with this change. * m4/sigaltstack.m4: Change copyright notice: Write "Copyright (C) FSF" instead of "Copyright (C) Eric Blake". * tests/altstack-util.h: Likewise. * tests/test-sigsegv-catch-stackoverflow1.c: Likewise. * tests/test-sigsegv-catch-stackoverflow2.c: Likewise.
* sigsegv, sigsegv-tests: Assign my contributions to the FSF.Bruno Haible2021-06-192-4/+7
| | | | | | | | | | | | | | | | * lib/sigsegv.in.h: Change copyright notice: Write "Copyright (C) FSF" instead of "Copyright (C) Bruno Haible". * lib/sigsegv.c: Likewise. * lib/stackvma.h: Likewise. * lib/stackvma.c: Likewise. * m4/sigaltstack.m4: Likewise. * m4/stack-direction.m4: Likewise. * tests/altstack-util.h: Likewise. * tests/mmap-anon-util.h: Likewise. * tests/test-sigsegv-catch-segv1.c: Likewise. * tests/test-sigsegv-catch-segv2.c: Likewise. * tests/test-sigsegv-catch-stackoverflow1.c: Likewise. * tests/test-sigsegv-catch-stackoverflow2.c: Likewise.
* Align 2011-11-26 patch to 2021-04-11 patch (regression from 2021-04-11).Bruno Haible2021-06-131-1/+2
| | | | | | | | | | | | | Reported by Paul Eggert. * m4/unistd_h.m4 (gl_UNISTD_H_REQUIRE_DEFAULTS): Also initialize GNULIB_UNISTD_H_GETOPT variable. * modules/getopt-posix (configure.ac): Set GNULIB_UNISTD_H_GETOPT variable. * modules/unistd (Makefile.am): Rely on ${gl_include_guard_prefix} processing done by gnulib-tool since 2021-04-11. * gnulib-tool: Revert last change. * pygnulib/GLEmiter.py: Likewise.
* Clarify that compiler warnings in the Gnulib tests can be ignored.Bruno Haible2021-06-101-1/+67
| | | | | | | | | | | * gnulib-tool (func_emit_tests_Makefile_am): Emit overrides for CFLAGS and CXXFLAGS. Emit a dependency of 'all' on 'all-notice' that prints a notice. (func_emit_initmacro_start): Add a second argument. If it is true, emit code to require gl_CC_ALLOW_WARNINGS and gl_CXX_ALLOW_WARNINGS. (func_import, func_create_testdir): All callers updated. * m4/gnulib-common.m4 (gl_CC_ALLOW_WARNINGS, gl_CXX_ALLOW_WARNINGS): New macros.
* host-os: Add support for DragonFly BSD.Bruno Haible2021-06-071-1/+2
| | | | | * m4/host-os.m4 (gl_HOST_OS): On DragonFly BSD, set HOST_OPERATING_SYSTEM to "DragonFly BSD", not "Dragonfly".
* lib-symbol-visibility: Make configure check work for newer GCC.Bruno Haible2021-06-051-1/+5
| | | | | | | | Reported by Ozkan Sezer <sezeroz@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-05/msg00117.html>. * m4/visibility.m4 (gl_VISIBILITY): Add a function definition for each declaration in the test program.
* sigsegv: don’t assume SIGSTKSZ is a constantPaul Eggert2021-05-211-33/+11
| | | | | | | | | | | | * m4/sigaltstack.m4 (SV_SIGALTSTACK): Don’t attempt to override SIGSTKSZ. Instead, use an array that is plenty large, while checking that it’s large enough. Also, be consistent about putting that array in static storage rather than on the stack. * tests/altstack-util.h (SIGSTKSZ): Don’t define. (MYSTACK_SIZE): New macro, used consistently instead of SIGSTKSZ. (mystack_storage, mystack): Now static. (prepare_alternate_stack) [defined SIGSTKSZ]: Check that MYSTACK_SIZE is large enough.
* c-stack: Support catching stack overflow on most platforms without libsigsegv.Bruno Haible2021-05-181-405/+8
| | | | | | | | | | * lib/c-stack.c: Remove all Solaris-specific code. Include <sigsegv.h> always. * m4/c-stack.m4: Remove all Solaris-specific code. (gl_C_STACK): Test $with_libsigsegv from module 'sigsegv'. * modules/c-stack (Files): Remove m4/libsigsegv.m4. (Depends-on): Add sigsegv. Remove havelib, intprops, inttypes, mempcpy, sigaction, stdbool.
* sigsegv, c-stack: Avoid compilation error with glibc >= 2.34.Bruno Haible2021-05-172-2/+54
| | | | | | | * lib/sigsegv.in.h (SIGSTKSZ): On glibc systems, redefine to a suitable constant. * m4/sigaltstack.m4 (SV_SIGALTSTACK): Likewise. * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Likewise.
* sigsegv: New module.Bruno Haible2021-05-162-0/+302
| | | | | | | | | | * lib/sigsegv.in.h: New file, from GNU libsigsegv with modifications. * lib/sigsegv.c: Likewise. * lib/stackvma.h: Likewise. * lib/stackvma.c: Likewise. * m4/sigaltstack.m4: Likewise. * m4/stack-direction.m4: Likewise. * modules/sigsegv: New file.
* c-stack: work around Solaris 11 bugsPaul Eggert2021-05-141-2/+12
| | | | | | | | | | | | | | Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2021-05/msg00062.html * lib/c-stack.c: Always include sigsegv.h if HAVE_LIBSIGSEGV. (USE_LIBSIGSEGV): Do not use libsigsegv if the kernel has the si_addr bug and libsigsegv is too old to work around it. (segv_handler) [!USE_LIBSIGSEGV]: Do not trust si_addr if BOGUS_SI_ADDR_UPON_STACK_OVERFLOW. * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): Define BOGUS_SI_ADDR_UPON_STACK_OVERFLOW on Solaris 2.11 SPARC. And do not define HAVE_XSI_STACK_OVERFLOW_HEURISTIC.
* valgrind-tests: Doc fix and introduce AM_VALGRINDFLAGS.Simon Josefsson2021-05-141-7/+18
| | | | | | | * doc/valgrind-tests.texi (Using valgrind automatically): Clarify when the parallel vs serial test harness is used, suggested by Bruno Haible <bruno@clisp.org>. * m4/valgrind-tests.m4: Add VALGRIND_PROGRAM and AM_VALGRINDFLAGS.
* malloc-gnu, realloc-gnu, calloc-gnu: Ensure errno gets set to ENOMEM.Bruno Haible2021-05-141-5/+9
| | | | | * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Set gl_cv_func_malloc_posix to 'no' also on Solaris.
* valgrind-tests: Fix 'sh: yes: unknown operand' error.Simon Josefsson2021-05-141-1/+1
| | | | * m4/valgrind-tests.m4: Protect variable usage.
* valgrind-tests: Fix LOG_VALGRIND when valgrind is missing.Simon Josefsson2021-05-141-4/+7
| | | | * m4/valgrind-tests.m4: Clear all variables when missing.
* valgrind-tests: Better option handling.Simon Josefsson2021-05-141-19/+48
| | | | | | * m4/valgrind-tests.m4: Support new variables VALGRINDFLAGS and DEFAULT_VALGRINDFLAGS. * doc/valgrind-tests.texi (Running self-tests under valgrind): Improve.
* posix_spawn, posix_spawnp: Fix build error on Minix 3.3.Bruno Haible2021-05-131-1/+13
| | | | | | | * m4/posix_spawn.m4 (gl_POSIX_SPAWN_BODY): If posix_spawn does not exist but is declared, set REPLACE_POSIX_SPAWN. * doc/posix-functions/posix_spawn.texi: Update platforms list. * doc/posix-functions/posix_spawnp.texi: Likewise.
* {realloc,calloc}-gnu: Fix autoconf macro (regression 2021-04-18).Bruno Haible2021-05-102-4/+8
| | | | | | | * m4/realloc.m4 (gl_FUNC_REALLOC_POSIX): Don't reset REPLACE_REALLOC to 0 if it is already 1 after gl_FUNC_REALLOC_GNU was executed. * m4/calloc.m4 (gl_FUNC_CALLOC_POSIX): Don't reset REPLACE_CALLOC to 0 if it is already 1 after gl_FUNC_CALLOC_GNU was executed.
* {malloc,realloc,calloc}-gnu: Fix autoconf macro (regression 2021-04-18).Bruno Haible2021-05-093-6/+12
| | | | | | | | | * m4/malloc.m4 (gl_FUNC_MALLOC_GNU): Don't assume that _AC_FUNC_MALLOC_IF expands to a single shell statement. * m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Don't assume that _AC_FUNC_REALLOC_IF expands to a single shell statement. * m4/calloc.m4 (gl_FUNC_CALLOC_GNU): Don't assume that _AC_FUNC_CALLOC_IF expands to a single shell statement.
* malloc-gnu, realloc-gnu, calloc-gnu: Ensure errno gets set on IRIX.Bruno Haible2021-05-091-11/+45
| | | | | * m4/malloc.m4 (gl_CHECK_MALLOC_POSIX): Require AC_CANONICAL_HOST. Set gl_cv_func_malloc_posix to 'no' also on IRIX.
* reallocarray: check for ptrdiff_t overflowPaul Eggert2021-04-242-2/+6
| | | | | | | | | | | | | | | | * doc/glibc-functions/reallocarray.texi (reallocarray): Mention ptrdiff_t overflow. * lib/reallocarray.c (reallocarray): Reindent as per usual GNU. * lib/stdlib.in.h (reallocarray): Allow reallocarray to be replaced. * m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY): Check for ptrdiff_t overflow. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Set up REPLACE_REALLOCARRAY. * modules/reallocarray (Files): Add malloc.m4. (configure.ac): Also test REPLACE_REALLOCARRAY. * modules/reallocarray-tests (Depends-on): Add stdint. * modules/stdlib (stdlib.h): Substitute REPLACE_REALLOCARRAY. * tests/test-reallocarray.c: Include stdint.h. (main): Check for ptrdiff_t overflow.
* malloc-gnu, etc.: prefer AS_CASE to woolly AS_IFPaul Eggert2021-04-183-6/+3
| | | | | | * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Use AS_CASE.
* malloc-gnu, etc.: sync better with AutoconfPaul Eggert2021-04-183-38/+25
| | | | | | | | | | | | * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Avoid some unnecessary differences from Autoconf’s versions. Separate our platforms into a different line so that it’s easier to diff. Use AS_IF in case the args use AC_REQUIRE. However, don’t bother with omitting the first newline, as omitting the newline is not Gnulib style and the difference doesn’t seem to matter here.
* More systematic file naming.Bruno Haible2021-04-183-2/+2
| | | | | | * m4/ctype_h.m4: Renamed from m4/ctype.m4. * m4/threads_h.m4: Renamed from m4/threads.m4. * m4/uchar_h.m4: Renamed from m4/uchar.m4.
* Add comments after 2021-04-11 change.Bruno Haible2021-04-1847-47/+372
| | | | | * m4/*_h.m4: Add comments regarding *_REQUIRE_DEFAULTS and *_MODULE_INDICATOR macros.
* doc: Update for FreeBSD 13.0/arm64.Bruno Haible2021-04-181-2/+2
| | | | | * doc/posix-headers/stdint.texi: Mention FreeBSD 13 bug. * m4/stdint.m4: Update comment.
* malloc, etc.: check for ptrdiff_t overflowPaul Eggert2021-04-173-92/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In glibc 2.30 and later, malloc, realloc and calloc reject attempts to create objects larger than PTRDIFF_MAX bytes. This patch changes malloc-gnu etc. to support this behavior on non-GNU hosts. It also makes this change for malloc-posix etc. since it’s a safety measure that ought to be in POSIX (perhaps we can talk them into that...). In writing this patch I found a complicated set of code that had accumulated over the years, some written by yours truly. I got rid of the code I couldn’t see the need for nowadays. Among other things, the GNU realloc behavior is no longer incompatible with the C standard, because in C17 the latter was relaxed to allow the former. If I went too far in cleaning up, the old stuff can be resurrected. This change is mostly for 32-bit platforms, since practical 64-bit platforms cannot create objects larger than PTRDIFF_MAX bytes anyway. * doc/posix-functions/calloc.texi: * doc/posix-functions/malloc.texi: * doc/posix-functions/realloc.texi: Mention ptrdiff_t issues, and go into more detail about what the gnu extension module does. * doc/posix-functions/realloc.texi: Fix now-obsolete commentary about C99 vs glibc, as C17 allows the glibc behavior and POSIX will follow suit when it gets around to it. * lib/calloc.c, lib/malloc.c, lib/realloc.c: Simplify by always supplying a GNU-compatible version, as that suffices for correctness and is good enough for performance. Include xalloc-oversized.h, and use xalloc_oversized to check for ptrdiff_t overflow. (NEED_CALLOC_GNU, NEED_MALLOC_GNU, NEED_REALLOC_GNU): Remove. * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Don’t start with a newline. Fix message to match behavior. * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Don’t test for size_t overflow, as the ptrdiff_t test is good enough. * m4/calloc.m4 (gl_FUNC_CALLOC_GNU): * m4/malloc.m4 (gl_FUNC_MALLOC_GNU): * m4/realloc.m4 (gl_FUNC_REALLOC_GNU): Do not define HAVE_CALLOC_GNU, HAVE_MALLOC_GNU, HAVE_REALLOC_GNU. It’s not worth the aggravation of maintaining these, as they are confusing (they don’t really mean GNU-compatible anyway). Don’t bother testing for GNU behavior if we have already decided to replace the function, since the replacement is always GNUish. * m4/calloc.m4 (gl_FUNC_CALLOC_POSIX): * m4/realloc.m4 (gl_FUNC_REALLOC_POSIX): Defer to gl_FUNC_MALLOC_POSIX. * m4/malloc.m4 (gl_FUNC_MALLOC_PTRDIFF, gl_CHECK_MALLOC_PTRDIFF): New macros. (gl_FUNC_MALLOC_POSIX): Use them to check for ptrdiff_t overflow. * modules/calloc-gnu, modules/malloc-gnu, modules/realloc-gnu: Remove no-longer-needed module indicators. * modules/calloc-posix, modules/malloc-posix, modules/realloc-posix: Depend on xalloc-oversized. * modules/malloc-posix: Require gl_FUNC_MALLOC_POSIX instead of calling it directly, so that other code can require it. * modules/realloc-posix: Depend on free-posix and malloc-posix.
* stdio: Fix build error in some configurations (regression 2021-04-11).Bruno Haible2021-04-171-24/+1
| | | | | | * m4/stdio_h.m4 (gl_STDIO_H): Move gl_STDIO_MODULE_INDICATOR and gl_MODULE_INDICATOR invocations from here... * modules/stdio (configure.ac): ... to here.
* doc: Update for FreeBSD 11.0, 12.0, 13.0.Bruno Haible2021-04-176-18/+21
| | | | | | | | | * doc/posix-headers/*.texi: Update. * doc/glibc-headers/*.texi: Update. * doc/posix-functions/*.texi: Likewise. * doc/pastposix-functions/*.texi: Likewise. * doc/glibc-functions/*.texi: Likewise. * m4/ptsname_r.m4 (gl_FUNC_PTSNAME_R): Update cross-compilation guess.
* Support several gnulib-tool invocations under the same configure.ac.Bruno Haible2021-04-11105-949/+1308
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by Reuben Thomas <rrt@sc3d.org> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-04/msg00104.html>. This is done by defining the Gnulib module indicator variables per gnulib-tool invocation. So that a generated .h file is no longer influenced by the set of modules used in other gnulib-tool invocations. * gnulib-tool (func_compute_include_guard_prefix): Set module_indicator_prefix. (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am): Use it to modify $(GNULIB_*) variable references in the Automake snippets. (func_emit_initmacro_start): Push macro definitions for GL_MACRO_PREFIX and GL_MODULE_INDICATOR_PREFIX. (func_emit_initmacro_end): Pop these macro definitions. * pygnulib/GLConfig.py (GLConfig.getIncludeGuardPrefix): New method. * pygnulib/GLEmiter.py (GLEmiter.initmacro_start): Push macro definitions for GL_MACRO_PREFIX and GL_MODULE_INDICATOR_PREFIX. (GLEmiter.initmacro_end): Pop these macro definitions. (GLEmiter.lib_Makefile_am, GLEmiter.tests_Makefile_am): Use the module indicator prefix to modify $(GNULIB_*) variable references in the Automake snippets. * m4/gnulib-common.m4 (gl_MODULE_INDICATOR_INIT_VARIABLE, gl_MODULE_INDICATOR_SET_VARIABLE): Use the value of GL_MODULE_INDICATOR_PREFIX. * m4/arpa_inet_h.m4: Use new idiom for header files that contain references to Gnulib module indicator variables: - Define the main macro through AC_DEFUN_ONCE. - Define a macro gl_*_H_REQUIRE_DEFAULTS that initializes the Gnulib module indicator variables (each prefixed with GL_MODULE_INDICATOR_PREFIX). - Invoke this macro in the gl_*_MODULE_INDICATOR macro. * m4/ctype.m4: Likewise. * m4/dirent_h.m4: Likewise. * m4/fcntl_h.m4: Likewise. * m4/fnmatch_h.m4: Likewise. * m4/glob_h.m4: Likewise. * m4/iconv_h.m4: Likewise. * m4/inttypes.m4: Likewise. * m4/langinfo_h.m4: Likewise. * m4/locale_h.m4: Likewise. * m4/malloc_h.m4: Likewise. * m4/math_h.m4: Likewise. * m4/monetary_h.m4: Likewise. * m4/netdb_h.m4: Likewise. * m4/poll_h.m4: Likewise. * m4/pthread_h.m4: Likewise. * m4/pty_h.m4: Likewise. * m4/sched_h.m4: Likewise. * m4/search_h.m4: Likewise. * m4/signal_h.m4: Likewise. * m4/spawn_h.m4: Likewise. * m4/stddef_h.m4: Likewise. * m4/stdio_h.m4: Likewise. * m4/stdlib_h.m4: Likewise. * m4/string_h.m4: Likewise. * m4/strings_h.m4: Likewise. * m4/sys_file_h.m4: Likewise. * m4/sys_ioctl_h.m4: Likewise. * m4/sys_random_h.m4: Likewise. * m4/sys_resource_h.m4: Likewise. * m4/sys_select_h.m4: Likewise. * m4/sys_socket_h.m4: Likewise. * m4/sys_stat_h.m4: Likewise. * m4/sys_time_h.m4: Likewise. * m4/sys_times_h.m4: Likewise. * m4/sys_types_h.m4: Likewise. * m4/sys_uio_h.m4: Likewise. * m4/sys_utsname_h.m4: Likewise. * m4/sys_wait_h.m4: Likewise. * m4/termios_h.m4: Likewise. * m4/threads.m4: Likewise. * m4/time_h.m4: Likewise. * m4/uchar.m4: Likewise. * m4/unistd_h.m4: Likewise. * m4/utime_h.m4: Likewise. * m4/wchar_h.m4: Likewise. * m4/wctype_h.m4: Likewise. * modules/arpa_inet (configure.ac): Invoke the macro gl_*_H_REQUIRE_DEFAULTS explicitly. * modules/ctype (configure.ac): Likewise. * modules/dirent (configure.ac): Likewise. * modules/fcntl-h (configure.ac): Likewise. * modules/fnmatch-h (configure.ac): Likewise. * modules/glob-h (configure.ac): Likewise. * modules/iconv-h (configure.ac): Likewise. * modules/inttypes-incomplete (configure.ac): Likewise. * modules/langinfo (configure.ac): Likewise. * modules/locale (configure.ac): Likewise. * modules/malloc-h (configure.ac): Likewise. * modules/math (configure.ac): Likewise. * modules/monetary (configure.ac): Likewise. * modules/netdb (configure.ac): Likewise. * modules/poll-h (configure.ac): Likewise. * modules/pthread-h (configure.ac): Likewise. * modules/pty (configure.ac): Likewise. * modules/sched (configure.ac): Likewise. * modules/search (configure.ac): Likewise. * modules/signal-h (configure.ac): Likewise. * modules/spawn (configure.ac): Likewise. * modules/stddef (configure.ac): Likewise. * modules/stdio (configure.ac): Likewise. * modules/stdlib (configure.ac): Likewise. * modules/string (configure.ac): Likewise. * modules/strings (configure.ac): Likewise. * modules/sys_file (configure.ac): Likewise. * modules/sys_ioctl (configure.ac): Likewise. * modules/sys_random (configure.ac): Likewise. * modules/sys_resource (configure.ac): Likewise. * modules/sys_select (configure.ac): Likewise. * modules/sys_socket (configure.ac): Likewise. * modules/sys_stat (configure.ac): Likewise. * modules/sys_time (configure.ac): Likewise. * modules/sys_times (configure.ac): Likewise. * modules/sys_types (configure.ac): Likewise. * modules/sys_uio (configure.ac): Likewise. * modules/sys_utsname (configure.ac): Likewise. * modules/sys_wait (configure.ac): Likewise. * modules/termios (configure.ac): Likewise. * modules/threads-h (configure.ac): Likewise. * modules/time (configure.ac): Likewise. * modules/uchar (configure.ac): Likewise. * modules/unistd (configure.ac): Likewise. * modules/utime-h (configure.ac): Likewise. * modules/wchar (configure.ac): Likewise. * modules/wctype-h (configure.ac): Likewise. * m4/af_alg.m4: Update after a macro name changed. * m4/ctime.m4: Likewise. * m4/explicit_bzero.m4: Likewise. * m4/ffs.m4: Likewise. * m4/ffsl.m4: Likewise. * m4/ffsll.m4: Likewise. * m4/flock.m4: Likewise. * m4/fstat.m4: Likewise. * m4/getaddrinfo.m4: Likewise. * m4/getdomainname.m4: Likewise. * m4/gettimeofday.m4: Likewise. * m4/hostent.m4: Likewise. * m4/ioctl.m4: Likewise. * m4/localtime.m4: Likewise. * m4/mbslen.m4: Likewise. * m4/memchr.m4: Likewise. * m4/memmem.m4: Likewise. * m4/mempcpy.m4: Likewise. * m4/memrchr.m4: Likewise. * m4/mktime.m4: Likewise. * m4/nanosleep.m4: Likewise. * m4/passfd.m4: Likewise. * m4/pselect.m4: Likewise. * m4/rawmemchr.m4: Likewise. * m4/select.m4: Likewise. * m4/servent.m4: Likewise. * m4/sigabbrev_np.m4: Likewise. * m4/sigdescr_np.m4: Likewise. * m4/sockpfaf.m4: Likewise. * m4/stat.m4: Likewise. * m4/stpcpy.m4: Likewise. * m4/stpncpy.m4: Likewise. * m4/strcase.m4: Likewise. * m4/strcasestr.m4: Likewise. * m4/strchrnul.m4: Likewise. * m4/strdup.m4: Likewise. * m4/strerror.m4: Likewise. * m4/strerror_r.m4: Likewise. * m4/strerrorname_np.m4: Likewise. * m4/strftime-fixes.m4: Likewise. * m4/strncat.m4: Likewise. * m4/strndup.m4: Likewise. * m4/strnlen.m4: Likewise. * m4/strpbrk.m4: Likewise. * m4/strptime.m4: Likewise. * m4/strsep.m4: Likewise. * m4/strsignal.m4: Likewise. * m4/strstr.m4: Likewise. * m4/strtok_r.m4: Likewise. * m4/strverscmp.m4: Likewise. * m4/time_r.m4: Likewise. * m4/time_rz.m4: Likewise. * m4/timegm.m4: Likewise. * m4/timespec_get.m4: Likewise. * m4/tzset.m4: Likewise. * modules/accept (configure.ac): Likewise. * modules/bind (configure.ac): Likewise. * modules/connect (configure.ac): Likewise. * modules/flock (configure.ac): Likewise. * modules/getpeername (configure.ac): Likewise. * modules/getsockname (configure.ac): Likewise. * modules/getsockopt (configure.ac): Likewise. * modules/listen (configure.ac): Likewise. * modules/recv (configure.ac): Likewise. * modules/recvfrom (configure.ac): Likewise. * modules/send (configure.ac): Likewise. * modules/sendto (configure.ac): Likewise. * modules/setsockopt (configure.ac): Likewise. * modules/shutdown (configure.ac): Likewise. * modules/socket (configure.ac): Likewise. Use the gl_*_H_REQUIRE_DEFAULTS macros. * modules/nonblocking (configure.ac): Use the gl_*_H_REQUIRE_DEFAULTS and gl_MODULE_INDICATOR_INIT_VARIABLE macros. * modules/sigpipe (configure.ac): Likewise. * modules/windows-stat-override (configure.ac): Likewise. * m4/nonblocking.m4: Update a comment. * m4/sigpipe.m4: Likewise.
* Rename GNULIB_OVERRIDES_CHAR16_T, GNULIB_OVERRIDES_CHAR32_T.Bruno Haible2021-04-112-8/+8
| | | | | | | * GNULIBHEADERS_OVERRIDE_CHAR16_T: Renamed from GNULIB_OVERRIDES_CHAR16_T. * GNULIBHEADERS_OVERRIDE_CHAR32_T: Renamed from GNULIB_OVERRIDES_CHAR32_T.
* Rename GNULIB_OVERRIDES_WINT_T.Bruno Haible2021-04-113-9/+9
| | | | * GNULIBHEADERS_OVERRIDE_WINT_T: Renamed from GNULIB_OVERRIDES_WINT_T.
* Simplify GNULIB_* variable initializations.Bruno Haible2021-04-1145-589/+599
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * modules/gnulib-common.m4 (gl_MODULE_INDICATOR_INIT_VARIABLE): New macro. * m4/arpa_inet_h.m4 (gl_ARPA_INET_H_DEFAULTS): Use it. * m4/ctype.m4 (gl_CTYPE_H_DEFAULTS): Likewise. * m4/dirent_h.m4 (gl_DIRENT_H_DEFAULTS): Likewise. * m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Likewise. * m4/fnmatch_h.m4 (gl_FNMATCH_H_DEFAULTS): Likewise. * m4/glob_h.m4 (gl_GLOB_H_DEFAULTS): Likewise. * m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS): Likewise. * m4/inttypes.m4 (gl_INTTYPES_H_DEFAULTS): Likewise. * m4/langinfo_h.m4 (gl_LANGINFO_H_DEFAULTS): Likewise. * m4/locale_h.m4 (gl_LOCALE_H_DEFAULTS): Likewise. * m4/malloc_h.m4 (gl_MALLOC_H_DEFAULTS): Likewise. * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Likewise. * m4/monetary_h.m4 (gl_MONETARY_H_DEFAULTS): Likewise. * m4/netdb_h.m4 (gl_NETDB_H_DEFAULTS): Likewise. * m4/poll_h.m4 (gl_POLL_H_DEFAULTS): Likewise. * m4/pthread_h.m4 (gl_PTHREAD_H_DEFAULTS): Likewise. * m4/pty_h.m4 (gl_PTY_H_DEFAULTS): Likewise. * m4/sched_h.m4 (gl_SCHED_H_DEFAULTS): Likewise. * m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Likewise. * m4/signal_h.m4 (gl_SIGNAL_H_DEFAULTS): Likewise. * m4/spawn_h.m4 (gl_SPAWN_H_DEFAULTS): Likewise. * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise. * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise. * m4/strings_h.m4 (gl_HEADER_STRINGS_H_DEFAULTS): Likewise. * m4/sys_file_h.m4 (gl_HEADER_SYS_FILE_H_DEFAULTS): Likewise. * m4/sys_ioctl_h.m4 (gl_SYS_IOCTL_H_DEFAULTS): Likewise. * m4/sys_random_h.m4 (gl_SYS_RANDOM_H_DEFAULTS): Likewise. * m4/sys_resource_h.m4 (gl_SYS_RESOURCE_H_DEFAULTS): Likewise. * m4/sys_select_h.m4 (gl_SYS_SELECT_H_DEFAULTS): Likewise. * m4/sys_socket_h.m4 (gl_SYS_SOCKET_H_DEFAULTS): Likewise. * m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise. * m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_DEFAULTS): Likewise. * m4/sys_times_h.m4 (gl_SYS_TIMES_H_DEFAULTS): Likewise. * m4/sys_utsname_h.m4 (gl_SYS_UTSNAME_H_DEFAULTS): Likewise. * m4/sys_wait_h.m4 (gl_SYS_WAIT_H_DEFAULTS): Likewise. * m4/termios_h.m4 (gl_TERMIOS_H_DEFAULTS): Likewise. * m4/threads.m4 (gl_THREADS_H_DEFAULTS): Likewise. * m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Likewise. * m4/uchar.m4 (gl_UCHAR_H_DEFAULTS): Likewise. * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise. * m4/utime_h.m4 (gl_UTIME_H_DEFAULTS): Likewise. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Likewise. * m4/wctype_h.m4 (gl_WCTYPE_H_DEFAULTS): Likewise.
* pthread-cond: Fix wrong configure results when <pthread.h> is absent.Fabrice Fontaine2021-04-051-9/+9
| | | | | * m4/pthread-cond.m4 (gl_PTHREAD_COND): When <pthread.h> does not exist, set HAVE_PTHREAD_COND_* to 0, not to 1.
* strtoll: Work around a bug on native Windows and Minix.Bruno Haible2021-04-022-3/+36
| | | | | | | | | | | * lib/stdlib.in.h (strtoll): Override if REPLACE_STRTOLL is 1. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_STRTOLL. * m4/strtoll.m4 (gl_FUNC_STRTOLL): Test whether strtoll works. Set REPLACE_STRTOLL. * modules/stdlib (Makefile.am): Substitute REPLACE_STRTOLL. * modules/strtoll (configure.ac): Test REPLACE_STRTOLL. * tests/test-strtoll.c (main): Add tests of hexadecimal integer syntax. * doc/posix-functions/strtoll.texi: Mention the bug.
* strtol: Work around a bug on native Windows and Minix.Bruno Haible2021-04-022-3/+42
| | | | | | | | | | | | | | | | | * lib/stdlib.in.h (strtol): New declaration. * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether strtol is declared. (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_STRTOL, HAVE_STRTOL, REPLACE_STRTOL. * m4/strtol.m4 (gl_FUNC_STRTOL): Require gl_STDLIB_H_DEFAULTS. Test whether strtol works. Set REPLACE_STRTOL. * modules/stdlib (Makefile.am): Substitute GNULIB_STRTOL, HAVE_STRTOL, REPLACE_STRTOL. * modules/strtol (Status, Notice): Remove. (Depends-on): Add stdlib. (configure.ac): Test HAVE_STRTOL and REPLACE_STRTOL. Invoke gl_STDLIB_MODULE_INDICATOR. * tests/test-strtol.c (main): Add tests of hexadecimal integer syntax. * doc/posix-functions/strtol.texi: Mention the bug.
* strtoull: Work around a bug on native Windows and Minix.Bruno Haible2021-04-022-3/+36
| | | | | | | | | | | * lib/stdlib.in.h (strtoull): Override if REPLACE_STRTOULL is 1. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_STRTOULL. * m4/strtoull.m4 (gl_FUNC_STRTOULL): Test whether strtoull works. Set REPLACE_STRTOULL. * modules/stdlib (Makefile.am): Substitute REPLACE_STRTOULL. * modules/strtoull (configure.ac): Test REPLACE_STRTOULL. * tests/test-strtoull.c (main): Add tests of hexadecimal integer syntax. * doc/posix-functions/strtoull.texi: Mention the bug.
* strtoul: Work around a bug on native Windows and Minix.Bruno Haible2021-04-022-3/+42
| | | | | | | | | | | | | | | | | | | | Reported by Eric Blake <eblake@redhat.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00082.html>. * lib/stdlib.in.h (strtoul): New declaration. * m4/stdlib_h.m4 (gl_STDLIB_H): Test whether strtoul is declared. (gl_STDLIB_H_DEFAULTS): Initialize GNULIB_STRTOUL, HAVE_STRTOUL, REPLACE_STRTOUL. * m4/strtoul.m4 (gl_FUNC_STRTOUL): Require gl_STDLIB_H_DEFAULTS. Test whether strtoul works. Set REPLACE_STRTOUL. * modules/stdlib (Makefile.am): Substitute GNULIB_STRTOUL, HAVE_STRTOUL, REPLACE_STRTOUL. * modules/strtoul (Status, Notice): Remove. (Depends-on): Add stdlib. (configure.ac): Test HAVE_STRTOUL and REPLACE_STRTOUL. Invoke gl_STDLIB_MODULE_INDICATOR. * tests/test-strtoul.c (main): Add tests of hexadecimal integer syntax. * doc/posix-functions/strtoul.texi: Mention the bug.
* doc: Update for macOS 11.1.Bruno Haible2021-03-211-7/+9
| | | | | | | | | | * doc/posix-headers/*.texi: Update. * doc/glibc-headers/*.texi: Update. * doc/posix-functions/*.texi: Likewise. * doc/pastposix-functions/*.texi: Likewise. * doc/glibc-functions/*.texi: Likewise. * m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Update cross-compilation guess.
* ftello: Work around bug in macOS >= 10.15.Bruno Haible2021-03-212-4/+21
| | | | | | | | | | | | | | | Reported by Martin Storsjö <martin@martin.st> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00002.html>. * m4/ungetc.m4 (gl_FUNC_UNGETC_WORKS): On macOS, don't define FUNC_UNGETC_BROKEN. Instead, set gl_ftello_broken_after_ungetc to yes. * m4/ftello.m4 (gl_FUNC_FTELLO): Invoke gl_FUNC_UNGETC_WORKS, and arrange to provide the workaround if ftello is broken after ungetc. * lib/ftello.c: Include <errno.h>, intprops.h. (ftello) [FTELLO_BROKEN_AFTER_UNGETC]: Implement from scratch. * modules/ftello (Files): Add m4/ungetc.m4. (Depends-on): Add intprops. * doc/posix-functions/ftello.texi: Mention the macOS bug.
* unlocked-io-internal: New module.Bruno Haible2021-03-071-6/+1
| | | | | | | | | | | | * m4/unlocked-io.m4 (gl_FUNC_GLIBC_UNLOCKED_IO): Don't define USE_UNLOCKED_IO here. * modules/unlocked-io-internal: New file, based on modules/unlocked-io. * modules/unlocked-io (Description): Clarify. (Files, Depends-on): Just use the unlocked-io-internal module. (configure.ac): Define GNULIB_STDIO_SINGLE_THREAD and USE_UNLOCKED_IO here. * doc/multithread.texi: Clarify when the 'unlocked-io' module can be used.
* stdalign: port to tcc + glibcPaul Eggert2021-03-041-1/+3
| | | | | | | | | | | | * lib/stdalign.in.h (_Alignas): Do not define using __attribute__ if __attribute__ is defined as a macro, as __attribute__ surely a no-op in that case and this is an area where __attribute__ cannot simply be ignored. * m4/stdalign.m4 (gl_STDALIGN_H): Include <stdint.h> so that it #defines __attribute__(x) to nothing on glibc-based systems when non-GNU-C-compatible compilers are used. This exposes a bug in Tiny C Compiler 0.9.27’s implementation of _Alignas on glibc platforms.
* Fix distinction of 32-bit/64-bit mode with xlc 13.1.3 on AIX.Bruno Haible2021-02-152-5/+5
| | | | | | | * m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI, gl_HOST_CPU_C_ABI_32BIT): Test __LP64__ instead of _ARCH_PPC64. * m4/lib-ld.m4 (AC_LIB_PROG_LD): Likewise. * lib/stddef.in.h: Likewise.
* lib-symbol-visibility: Make it work with -Wmissing-prototypes.Ozkan Sezer2021-02-131-1/+2
| | | | | * m4/visibility.m4 (gl_VISIBILITY): Avoid error from simultaneous use of -Wmissing-prototypes and -Werror.
* Add cross-compilation guesses for MidnightBSD.Bruno Haible2021-02-078-16/+25
| | | | | | | | | | | | | | | | * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): When cross-compiling, use the result from native compilation. * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): Likewise. * m4/mbrtoc32.m4 (gl_MBRTOC32_SANITYCHECK): Likewise. * m4/mprotect.m4 (gl_FUNC_MPROTECT_WORKS): Likewise. * m4/posix_spawn.m4 (gl_POSIX_SPAWN_SECURE): Likewise. * m4/printf.m4 (gl_PRINTF_SIZES_C99, gl_PRINTF_INFINITE, gl_PRINTF_INFINITE_LONG_DOUBLE, gl_PRINTF_DIRECTIVE_F, gl_SNPRINTF_TRUNCATION_C99, gl_SNPRINTF_RETVAL_C99, gl_SNPRINTF_DIRECTIVE_N, gl_VSNPRINTF_ZEROSIZE_C99): Likewise. * m4/strfmon_l.m4 (gl_FUNC_STRFMON_L): Likewise. * m4/setlocale_null.m4 (gl_FUNC_SETLOCALE_NULL): Use predetermined result on MidnightBSD.
* threadlib: Add support for MidnightBSD.Bruno Haible2021-02-071-3/+3
| | | | | * m4/threadlib.m4 (gl_WEAK_SYMBOLS, gl_THREADLIB_BODY): On MidnightBSD, use the same test as on FreeBSD.
* host-os: Add support for MidnightBSD.Bruno Haible2021-02-071-1/+2
| | | | | * m4/host-os.m4 (gl_HOST_OS): On MidnightBSD, set HOST_OPERATING_SYSTEM to "MidnightBSD", not "Midnightbsd".
* c-stack: Adjust for MidnightBSD.Bruno Haible2021-02-071-2/+2
| | | | | * m4/c-stack.m4 (AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC): On MidnightBSD, set FAULT_YIELDS_SIGBUS.
* relocatable-prog: Add support for MidnightBSD.Bruno Haible2021-02-071-3/+4
| | | | | | | * m4/relocatable.m4 (gl_RELOCATABLE_BODY): Use the ELF $ORIGIN trick also on MidnightBSD >= 1.1. * build-aux/config.libpath: Treat MidnightBSD like FreeBSD. * build-aux/reloc-ldflags: Likewise.