summaryrefslogtreecommitdiff
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* spawn-pipe: Fix test failure when running under QEMU user-mode.Bruno Haible2021-08-301-0/+2
| | | | | | | | * tests/test-spawn-pipe-child.c: Include <stdbool.h>, <string.h>, qemu.h. (main): Under QEMU user-mode, allow fd 2 or fd 3 to be open. * modules/spawn-pipe-tests (Files): Add qemu.h. (Depends-on): Add stdbool.
* execute: Fix test failure when running under QEMU user-mode.Bruno Haible2021-08-301-0/+2
| | | | | | | * tests/test-execute-child.c: Include <stdbool.h>, qemu.h. (main): Under QEMU user-mode, allow fd 3 to be open. * modules/execute-tests (Files): Add qemu.h. (Depends-on): Add stdbool.
* posix_spawn_file_actions_addfchdir: Avoid test failure under QEMU.Bruno Haible2021-08-301-0/+2
| | | | | | | | | | | * tests/test-posix_spawn-fchdir.c: Include qemu.h. (is_qemu): New variable. (test): Under QEMU user-mode, don't expect that "pwd" produces the result "/". (main): Initialize is_qemu. Under QEMU user-mode, skip the relative file name test. * modules/posix_spawn_file_actions_addfchdir-tests (Files): Add qemu.h. (Depends-on): Add stdbool.
* getcwd tests: Avoid test failure when running under QEMU user-mode.Bruno Haible2021-08-301-1/+3
| | | | | | | | * modules/getcwd-tests (Files): Add qemu.h. (Depends-on): Add stdbool. * tests/test-getcwd.c: Include qemu.h. (test_long_name): Skip this test when running under QEMU user-mode. (main): Consider return code 77 from test_long_name.
* base32, base64: fix broken testsPaul Eggert2021-08-292-2/+0
| | | | | | | | | | | | Problem reported by Bruno Haible in: https://lists.gnu.org/r/bug-gnulib/2021-08/msg00170.html * lib/base32.c, lib/base64.c: Do not include verify.h, and omit all uses of ‘assume’. * modules/base32, modules/base64 (Depends-on): Remove verify. * tests/test-base32.c, tests/test-base64.c: Don’t pass out-of-range values to allocator, as converting them to idx_t relies on implementation-defined behavior that could trap.
* ialloc: relicensePaul Eggert2021-08-291-1/+1
| | | | * modules/ialloc (License): Change from LGPL to LGPLv2+.
* Skip some tests when running under QEMU user-mode.Bruno Haible2021-08-294-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/qemu.h: New file. * tests/test-get-rusage-as.c: Include qemu.h. (main): Skip the test when running under QEMU. * tests/test-get-rusage-data.c: Include qemu.h. (main): Skip the test when running under QEMU. * tests/test-printf-posix2.c: Include qemu.h. (main): Return with code 77 when running under QEMU. * tests/test-fprintf-posix2.c: Include qemu.h. (main): Return with code 77 when running under QEMU. * tests/test-fprintf-posix3.c: Include qemu.h. (main): Return with code 79 when running under QEMU. * tests/test-fprintf-posix3.sh: Skip the test when the return code was 79. * tests/test-dprintf-posix2.c: Include qemu.h. (main): Return with code 79 when running under QEMU. Use return code 80 instead of 78. * tests/test-dprintf-posix2.sh: Skip the test when the return code was 79. Update for changed return code. * modules/get-rusage-as-tests (Files): Add qemu.h. (Depends-on): Add stdbool. * modules/get-rusage-data-tests (Files): Add qemu.h. (Depends-on): Add stdbool. * modules/fprintf-posix-tests (Files): Add qemu.h. (Depends-on): Add stdbool. * modules/dprintf-posix-tests (Files): Add qemu.h. (Depends-on): Add stdbool.
* base32, base64: prefer signed to unsigned integersPaul Eggert2021-08-272-0/+4
| | | | | | | | | | | | | | | | | | | | * lib/base32.c, lib/base64.c: Include ialloc.h instad of stdlib.h. Include intprops.h, verify.h. * lib/base32.c (base32_encode, base32_encode_alloc, get_8, decode_8) (base32_decode_ctx, base32_decode_alloc_ctx): * lib/base32.h (struct base32_decode_context): * lib/base64.c (base64_encode_fast, base64_encode) (base64_encode_alloc, get_4, decode_4, base64_decode_ctx) (base64_decode_alloc_ctx): * lib/base64.h (struct base64_decode_context): * tests/test-base32.c (main): * tests/test-base64.c (main): Prefer signed to unsigned integers. * lib/base32.c (base32_encode_alloc): * lib/base64.c (base64_encode_alloc): Use simpler and more-direct check for overflow, removing a TODO. * lib/base32.h, lib/base64.h: Include idx.h instead of stddef.h. * modules/base32, modules/base64 (Depends-on): Add ialloc, verify.
* execute tests: Fix test failure when libtool is in use.Bruno Haible2021-08-253-0/+3
| | | | | | | | | * modules/execute-tests (Makefile.am): Link test-execute-child without using libtool. * modules/spawn-pipe-tests (Makefile.am): Link test-spawn-pipe-child without using libtool. * modules/system-quote-tests (Makefile.am): Link test-system-quote-child without using libtool.
* snippet/unused-parameter: Mark unused module obsolete.Bruno Haible2021-08-231-0/+6
| | | | * modules/snippet/unused-parameter (Status, Notice): Mark as obsolete.
* c-stack: depend on inttypes, mempcpyPaul Eggert2021-08-221-0/+2
| | | | | | * modules/c-stack (Depends-on): Add inttypes, mempcpy. mempcpy problem reported by Evan Miller in: https://debbugs.gnu.org/50098#31
* c-stack: Test for libsigsegv once, not twice.Bruno Haible2021-08-221-9/+6
| | | | | | | | * m4/sigsegv.m4: New file, based on modules/sigsegv. * modules/sigsegv (Files): Add it. (configure.ac): Require gl_SIGSEGV. Test gl_sigsegv_uses_libsigsegv instead of with_libsigsegv and gl_cv_lib_sigsegv. * m4/c-stack.m4 (gl_C_STACK): Likewise.
* rawmemchr: Fix use in relocatable-prog-wrapper (regression 2021-08-20).Bruno Haible2021-08-221-0/+1
| | | | | * lib/rawmemchr.c: Restore test of HAVE_RAWMEMCHR. * modules/relocatable-prog-wrapper (Depends-on): Add stdalign.
* rawmemchr: modernize and simplifyPaul Eggert2021-08-201-0/+3
| | | | | | | | | | | | | | | | * lib/rawmemchr.c (HAVE_RAWMEMCHR): Assume it’s not defined; otherwise this file would not be compiled. Include limits.h, stdalign.h, stdint.h, verify.h. (rawmemchr): Prefer uintptr_t to unsigned long and to size_t when it’s the better type. Verify that longword lacks padding. Use alignof rather than sizeof when checking alignment. Simplify by assuming C99 decl-after-statement, and by using multiplication rather than repeated shifting and OR (modern compilers can optimize the multiplication if needed). Avoid unnecessary casts. Don’t assume CHAR_WIDTH is 8. Convert back and forth between void * to suppress bogus GCC warnings about alignment. Omit a duplicate assignment to char_ptr. * modules/rawmemchr (Depends-on): Add stdalign, stdint, verify.
* fopen: Fix link error on native Windows.Bruno Haible2021-08-081-0/+1
| | | | * modules/fopen (Depends-on): Add close.
* fopen: Fix compilation error on AIX (regression from 2020-05-28).Bruno Haible2021-08-081-0/+1
| | | | * modules/fopen (Depends-on): Add fcntl-h.
* stdlib, string, wchar: Improve GCC 11 allocation-deallocation checking.Bruno Haible2021-08-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | * lib/stdlib.in.h (aligned_alloc): For GCC >= 11: Declare also when the platform already declares the function or when the module 'aligned_alloc' is not in use. (calloc): For GCC >= 11: Declare nearly always. (canonicalize_file_name): For GCC >= 11: Declare also when the platform already declares the function or when the module 'canonicalize-lgpl' is not in use. (malloc, realloc): For GCC >= 11: Declare nearly always. * lib/malloc.in.h: Remove redundant include. (memalign): For GCC >= 11: Declare also when the platform already declares the function or when the module 'memalign' is not in use. * lib/string.in.h: Include <stdlib.h> always. (strdup): For GCC >= 11: Declare also when the platform already declares the function or when the module 'strdup' or 'strdup-posix' is not in use. * lib/wchar.in.h: Include <stdlib.h> always. (wcsdup): For GCC >= 11: Declare also when the platform already declares the function or when the module 'wcsdup' is not in use. * modules/free-posix (Depends-on): Add string, wchar.
* xgetdomainname: Ensure .c file starts with '#include <config.h>'.Bruno Haible2021-08-072-1/+4
| | | | | | | | | | * lib/xgetaname-impl.h: New file, based on lib/xgethostname.c. * lib/xgethostname.c: Move implementation to lib/xgetaname-impl.h. * lib/xgetdomainname.c: Include <config.h>. Include xgetaname-impl.h instead of xgethostname.c. * modules/xgethostname (Files): Add lib/xgetaname-impl.h. * modules/xgetdomainname (Files): Likewise. (Depends-on): Remove xgethostname. Add free-posix, xalloc.
* glob: merge from glibcPaul Eggert2021-08-061-0/+1
| | | | | | * lib/glob-libc.h, lib/glob.c: Merge changes from glibc 2.34. The result should be copyable directly into glibc. * modules/glob-h (glob-libc.gl.h): Also omit __THROWNL.
* gnulib-common: update for C2x 2020-12-11 draftPaul Eggert2021-07-313-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use blessed-by-draft-standard way to test for [[__deprecated__]] etc.; this is supported by GCC 11 and the fallback code should work fine with GCC 10 and earlier, clang, etc. * NEWS, doc/attribute.texi: Mention that DEPRECATED etc. must now come first. * lib/fflush.c, lib/unistr.in.h: Do not include unused-parameter.h. All uses of _GL_UNUSED_PARAMETER (after parameters) replaced by _GL_ATTRIBUTE_MAYBE_UNUSED (before parameters). Although perhaps we need a shorter name for _GL_ATTRIBUTE_MAYBE_UNUSED, that should probably be in gnulib-common.m4, due to the ubiquity of this issue. And perhaps the snippet/unused-parameter module should be marked obsolete since it's no longer compatible with its old use. * m4/gnulib-common.m4 (gl_COMMON_BODY): Define the macro _GL_HAS_C_ATTRIBUTE, and use it instead of __STDC_VERSION__ in deciding whether to use C2x attributes like [[__deprecated__]]. (_GL_ATTRIBUTE_MAYBE_UNUSED): Fall back on _GL_ATTRIBUTE_UNUSED. (_GL_ATTRIBUTE_UNUSED): New macro, for labels where C2x [[maybe_unused]] do not work. (_GL_UNUSED, _GL_UNUSED_LABEL): Use it. * modules/fflush, modules/unistr/base (Depends-on): Remove snippet/unused-parameter. * modules/fflush (selinux/selinux.h, selinux/context.h) (selinux/label.h): Do not use $(UNUSED_PARAMETER). Remove useless chmod a-x.
* Assume GNU gettext >= 0.17.Bruno Haible2021-07-257-36/+0
| | | | | | | | | | | * modules/vasprintf (Notice): Remove. * modules/xvasprintf (Notice): Remove. * modules/xprintf (Notice): Remove. * modules/error (Notice): Remove. * modules/verror (Notice): Remove. * modules/argp (Notice): Remove. * modules/propername (Notice): Remove. * lib/propername.h: Remove outdated comment.
* posixtm: pacify latest GCCPaul Eggert2021-07-171-1/+4
| | | | | | | | | | | | | | | Also, modernize while I’m at it. * lib/posixtm.c: Include c-ctype.h, idx.h, intprops.h, verify.h instead of stdlib.h. (ISDIGIT): Remove. All uses replaced by c_isdigit. (year, posix_time_parse): Prefer idx_t to size_t. Use assume instead of abort. (posixtime): Do not parse twice; once is enough. That way, we needn’t worry about a bogus warning about strcpy overrunning a buffer from GCC 11.1.1 20210531 (Red Hat 11.1.1-3) x86-64 when coreutils is configured with --enable-gcc-warnings. * modules/posixtm (Depends-on): Add c-ctype, intprops, verify. Remove stpcpy.
* year2038: support glibc 2.34 _TIME_BITS=64Paul Eggert2021-07-011-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | In glibc 2.34 on Linux kernels where time_t is traditionally 32-bit, defining _FILE_OFFSET_BITS=64 and _TIME_BITS=64 makes time_t 64-bit. Apps must define both macros. Gnulib applications that use either the largefile or the year2038 modules will want this behavior; largefile because it deals with the off_t and ino_t components of struct stat already, and so should also deal with time_t. * NEWS, doc/largefile.texi, doc/posix-headers/time.texi: Mention this. * m4/largefile.m4: Override two macros even in Autoconf 2.70 and later. (_AC_SYS_LARGEFILE_MACRO_VALUE): #undef $1 before #defining it, in case some other Gnulib macro has #defined it. (AC_SYS_LARGEFILE): Use AS_IF and AS_CASE to propagate AC_REQUIREs. Invoke gl_YEAR2038_BODY if we need to set _FILE_OFFSET_BITS=64. * m4/year2038.m4 (gl_YEAR2038_TEST_INCLUDES): New macro. (gl_YEAR2038_BODY): New macro, with gl_YEAR2038’s old body; this macro is designed to be used directly instead of being AC_REQUIREd. It takes an argument specifying whether 64-bit is required. Set _TIME_BITS=64 if this makes a difference in time_t width when setting _FILE_OFFSET_BITS=64. Do not warn about 32-bit time_t more than once. * modules/largefile (Files): Add year2038.m4. (Depends-on): Require gl_YEAR2038_EARLY.
* relocatable-prog-wrapper: add m4 filesPaul Eggert2021-07-011-0/+5
| | | | | | | | | Add .m4 files needed for standalone relocatable-prog-wrapper, so that ‘./gnulib-tool --test relocatable-prog-wrapper’ does not fail with diagnostics like ‘configure.ac:63: error: possibly undefined macro: gl_FUNC_MALLOC_POSIX’. * modules/relocatable-prog-wrapper (Files): Add m4/free.m4, m4/malloc.m4, m4/mempcpy.m4, m4/rawmemchr.m4, m4/realloc.m4.
* unitypes: Fix trouble caused by installed older versions of unitypes.h.Bruno Haible2021-06-201-0/+16
| | | | * modules/unitypes (configure.ac): Define _UC_RESTRICT through config.h.
* tsearch: Relicense under LGPLv2+.Bruno Haible2021-06-161-1/+1
| | | | | * modules/tsearch (License): Change to LGPLv2+. * lib/tsearch.c: Update license notice.
* xnanosleep: Improve module description.Bruno Haible2021-06-151-1/+1
| | | | | | * modules/xnanosleep (Description): Improve. * lib/xnanosleep.h: Add comment. Make includable from C++. * lib/xnanosleep.c: Update comment.
* xfreopen: Improve module description.Bruno Haible2021-06-151-1/+1
| | | | | | * modules/xfreopen (Description): Improve. * lib/xfreopen.h: Add comments. Make includable from C++. * lib/xfreopen.c: Update comment.
* Align 2011-11-26 patch to 2021-04-11 patch (regression from 2021-04-11).Bruno Haible2021-06-132-4/+4
| | | | | | | | | | | | | 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.
* linebuffer: prefer idx_t for indexesPaul Eggert2021-06-111-1/+1
| | | | | | | | * lib/linebuffer.c (readlinebuffer_delim): * lib/linebuffer.h (struct linebuffer): Prefer idx_t to size_t for indexes, using idx_t-related allocators. * lib/linebuffer.h: Include idx.h. * modules/linebuffer (Depends-on): Add idx.
* dirname: prefer idx_t for some indexesPaul Eggert2021-06-111-1/+0
| | | | | | | | * lib/basename.c (base_name): Prefer idx_t to size_t for indexes, and use idx_t-related allocators. * lib/basename.c: Do not include xstrndup.h. (basename): Simplify by always using memcpy. * modules/dirname (Depends-on): Removbe xstrndup.
* xalloc: new idx_t-based allocatorsPaul Eggert2021-06-111-0/+1
| | | | | | | | | | | | | | | | This is for code that prefers to use idx_t for sizes. * lib/xalloc.h (ximalloc, xizalloc, xicalloc, xirealloc) (xireallocarray, ximemdup, ximemdup0) [GNULIB_XALLOC]: New decls. (x2nrealloc): Now just a decl, as the body is moved into xmalloc.c. * lib/xmalloc.c: Include ialloc.h. Rename some local parameters to be consistent with the .h files. (nonnull): New static function. (xmalloc, xcalloc): Simplify by using nonnull. (ximalloc, xirealloc, xireallocarray, xizalloc, xicalloc) (ximemdup, ximemdup0): New functions. (x2nrealloc): Moved here from xalloc.h. * modules/xalloc (Depends-on): Add ialloc.
* ialloc: new modulePaul Eggert2021-06-111-0/+29
| | | | * lib/ialloc.c, lib/ialloc.h, modules/ialloc: New files.
* dynarray, scratch_buffer: Fix VPATH builds (regression from yesterday).Bruno Haible2021-06-082-0/+5
| | | | | | | | | * modules/dynarray (configure.ac): Invoke AC_PROG_MKDIR_P. (Makefile.am): Create malloc/ directory before creating malloc/dynarray.gl.h and malloc/dynarray-skeleton.gl.h. * modules/scratch_buffer (configure.ac): Invoke AC_PROG_MKDIR_P. (Makefile.am): Create malloc/ directory before creating malloc/scratch_buffer.gl.h.
* scratch_buffer: Avoid conflict with prepr. macros owned by the system.Bruno Haible2021-06-071-0/+15
| | | | | | | | | * lib/scratch_buffer.h: Don't include <libc-config.h>. Define _GL_LIKELY, _GL_UNLIKELY. Include malloc/scratch_buffer.gl.h instead of malloc/scratch_buffer.h. * modules/scratch_buffer (Depends-on): Add builtin-expect. (Makefile.am): Arrange to create malloc/scratch_buffer.gl.h from malloc/scratch_buffer.h.
* dynarray: Avoid conflict with preprocessor macros owned by the system.Bruno Haible2021-06-071-0/+25
| | | | | | | | | | | * lib/dynarray.h: Don't include <libc-config.h>. Define _GL_LIKELY, _GL_UNLIKELY. Include malloc/dynarray.gl.h instead of malloc/dynarray.h. Include malloc/dynarray-skeleton.gl.h instead of malloc/dynarray-skeleton.c. * modules/dynarray (Depends-on): Add builtin-expect. (Makefile.am): Arrange to create malloc/dynarray.gl.h from malloc/dynarray.h and malloc/dynarray-skeleton.gl.h from malloc/dynarray-skeleton.c.
* glob-h: Make last patch work with Solaris 10 cc.Bruno Haible2021-06-071-0/+1
| | | | * modules/glob-h (Makefile.am): Also transform the '__restrict' macro.
* glob-h: Avoid conflict with preprocessor macros owned by the system.Bruno Haible2021-06-071-0/+17
| | | | | | | | | | This fixes a compilation error on DragonFly BSD 6.0. * lib/glob.in.h: Don't include <libc-config.h>. Don't define __USE_GNU. Include glob-libc.gl.h instead of glob-libc.h. * modules/glob-h (Makefile.am): Arrange to create glob-libc.gl.h from glob-libc.h. * lib/libc-config.h: Add comment.
* git-merge-changelog: Fix license.Bruno Haible2021-06-041-1/+1
| | | | | * modules/git-merge-changelog (License): Change back to GPL. * lib/git-merge-changelog.c: Use a GPLv3+ notice.
* gnupload, git-merge-changelog: Fix module description.Bruno Haible2021-06-042-2/+2
| | | | | | | | * gnulib-tool (func_import, func_create_testdir): Treat 'GPLv2+ build tool' like 'GPLed build tool'. * pygnulib/GLImport.py (prepare): Likewise. * modules/gnupload (License): Change to 'GPLv2+ build tool'. * modules/git-merge-changelog (License): Change to GPLv2+.
* Write 'LGPLv3+ or GPLv2+' instead of 'LGPLv3+ or GPLv2'.Bruno Haible2021-05-30509-509/+509
| | | | | * modules/* (License): Change. * gnulib-tool (func_import, func_create_testdir): Likewise.
* c-stack: Support catching stack overflow on most platforms without libsigsegv.Bruno Haible2021-05-181-7/+1
| | | | | | | | | | * 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: Add tests.Bruno Haible2021-05-161-0/+31
| | | | | | | | | | | * tests/test-sigsegv-catch-segv1.c: New file, from GNU libsigsegv with modifications. * tests/test-sigsegv-catch-segv2.c: Likewise. * tests/test-sigsegv-catch-stackoverflow1.c: Likewise. * tests/test-sigsegv-catch-stackoverflow2.c: Likewise. * tests/altstack-util.h: Likewise. * tests/mmap-anon-util.h: Likewise. * modules/sigsegv-tests: New file.
* sigsegv: New module.Bruno Haible2021-05-161-0/+101
| | | | | | | | | | * 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.
* linked-list-unportable-test: New module.Bruno Haible2021-05-142-22/+35
| | | | | | | * modules/linked-list-unportable-tests: New file, based on modules/linked-list-tests. * modules/linked-list-tests: Remove the unportable tests from here. Depend on linked-list-unportable-tests.
* *alloc-gnu tests: Use ASSERT macro.Bruno Haible2021-05-144-0/+4
| | | | | | | | | | | | | | | * tests/test-malloc-gnu.c: Include "macros.h". (main): Use ASSERT. * tests/test-calloc-gnu.c: Include "macros.h". (main): Use ASSERT. * tests/test-realloc-gnu.c: Include "macros.h". (main): Use ASSERT. * tests/test-reallocarray.c: Include "macros.h". (main): Use ASSERT. * modules/malloc-gnu-tests (Files): Add tests/macros.h. * modules/calloc-gnu-tests (Files): Likewise. * modules/realloc-gnu-tests (Files): Likewise. * modules/reallocarray-tests (Files): Likewise.
* Fix build error when libintl is installed.Bruno Haible2021-05-092-0/+2
| | | | | | | * modules/posix_spawn_file_actions_addchdir-tests (Makefile.am): Link test-posix_spawn-chdir with libintl. * modules/posix_spawn_file_actions_addfchdir-tests (Makefile.am): Link test-posix_spawn-fchdir with libintl.
* Fix build when an older libunistring is installed (regr. 2020-02-23).Bruno Haible2021-05-0711-11/+11
| | | | | | | | | | | | | | | | * modules/unitypes (configure.ac): Arrange to generate the .h file if the installed one is from a version < 0.9.11. * modules/unicase/base (configure.ac): Likewise. * modules/uniconv/base (configure.ac): Likewise. * modules/unilbrk/base (configure.ac): Likewise. * modules/uninorm/base (configure.ac): Likewise. * modules/unistdio/base (configure.ac): Likewise. * modules/unistr/base (configure.ac): Likewise. * modules/uniwbrk/base (configure.ac): Likewise. * modules/uniwidth/base (configure.ac): Likewise. * modules/unictype/base (configure.ac): Arrange to generate the .h file if the installed one is from a version < 0.9.8. * modules/unigbrk/base (configure.ac): Likewise.
* reallocarray: a bit more tuningPaul Eggert2021-04-251-2/+2
| | | | | | | | | | * lib/reallocarray.c: Include intprops.h. (reallocarray): Use INT_MULTIPLY_WRAPV instead of xalloc_oversized, as it now suffices and is likely a bit more efficient (five fewer machine insns on Ubuntu 20.10 x86-64). * modules/reallocarray (Depends-on): Depend on intprops, not xalloc-oversized. Use conditional dependencies to avoid building realloc-gnu when not needed.
* xmalloca, etc.: fix some xalloc-oversized issuesPaul Eggert2021-04-241-0/+1
| | | | | | | | | | | | | | | | | * lib/malloca.h (nmalloca): * lib/xmalloca.h (xnmalloca): Convert S to ptrdiff_t to avoid arithmetic overflow if N and S are both narrower than ptrdiff_t. * lib/xalloc-oversized.h (xalloc_oversized): Don’t say that args must be ptrdiff_t or size_t or wider. The macro returns the correct answer even when that is not the case, and it’s the caller’s responsibility to avoid howlers like (xalloc_oversized (n, s) ? NULL : malloc (n * s)) when N and S are both narrower than ptrdiff_t and size_t. Add a comment to that effect. * lib/xmalloca.h: Include xalloc-oversized.h, since this file uses xalloc_oversized. Add comments about side effects and avoid unnecessary parens. * modules/xmalloca (Depends-on): Add xalloc-oversized.