| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* modules/ialloc (License): Change from LGPL to LGPLv2+.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* modules/snippet/unused-parameter (Status, Notice): Mark as obsolete.
|
|
|
|
|
|
| |
* modules/c-stack (Depends-on): Add inttypes, mempcpy.
mempcpy problem reported by Evan Miller in:
https://debbugs.gnu.org/50098#31
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* lib/rawmemchr.c: Restore test of HAVE_RAWMEMCHR.
* modules/relocatable-prog-wrapper (Depends-on): Add stdalign.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* modules/fopen (Depends-on): Add close.
|
|
|
|
| |
* modules/fopen (Depends-on): Add fcntl-h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* modules/unitypes (configure.ac): Define _UC_RESTRICT through config.h.
|
|
|
|
|
| |
* modules/tsearch (License): Change to LGPLv2+.
* lib/tsearch.c: Update license notice.
|
|
|
|
|
|
| |
* modules/xnanosleep (Description): Improve.
* lib/xnanosleep.h: Add comment. Make includable from C++.
* lib/xnanosleep.c: Update comment.
|
|
|
|
|
|
| |
* modules/xfreopen (Description): Improve.
* lib/xfreopen.h: Add comments. Make includable from C++.
* lib/xfreopen.c: Update comment.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* lib/ialloc.c, lib/ialloc.h, modules/ialloc: New files.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* modules/glob-h (Makefile.am): Also transform the '__restrict' macro.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* modules/git-merge-changelog (License): Change back to GPL.
* lib/git-merge-changelog.c: Use a GPLv3+ notice.
|
|
|
|
|
|
|
|
| |
* 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+.
|
|
|
|
|
| |
* modules/* (License): Change.
* gnulib-tool (func_import, func_create_testdir): Likewise.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|