1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-09-01 02:34:55 +00:00
Commit Graph

22573 Commits

Author SHA1 Message Date
Paul Eggert 39da61d3c3 largefile: sync from Autoconf master
* m4/largefile.m4 (gl_SET_LARGEFILE_SOURCE): Test whether
AC_SYS_YEAR2038 is defined when this macro is defined, not when it
is used, as we now define AC_SYS_YEAR2038 later.
(_AC_SYS_LARGEFILE_MACRO_VALUE): Remove.
(_AC_SYS_YEAR2038_TEST_CODE, _AC_SYS_YEAR2038_OPTIONS)
(_AC_SYS_YEAR2038_PROBE, _AC_SYS_YEAR2038_ENABLE)
(_AC_SYS_YEAR2038_OPT_IN, AC_SYS_YEAR2038)
(_AC_SYS_LARGEFILE_TEST_CODE, _AC_SYS_LARGEFILE_OPTIONS)
(_AC_SYS_LARGEFILE_PROBE, _AC_SYS_LARGEFILE_ENABLE): New macros.
(AC_SYS_LARGEFILE): Use them.
* m4/year2038.m4: Remove.  All mentions removed.
* modules/largefile, modules/year2038 (configure.ac-early):
Do not require gl_YEAR2038_EARLY.
* modules/year2038 (Depends-on): Depend on largefile.
(configure.ac): Require AC_SYS_YEAR2038, not gl_YEAR2038.
2023-03-29 01:34:23 +02:00
Paul Eggert 9cf27a431b largefile, year2038: simplify if Autoconf 2.72
* m4/largefile.m4 (gl_SET_LARGEFILE_SOURCE)
(_AC_SYS_LARGEFILE_MACRO_VALUE):
* m4/year2038.m4 (gl_YEAR2038_EARLY, gl_YEAR2038, gl_YEAR2038_BODY):
Adjust to Autoconf 2.72, which should contain the Gnulib
patches in this area and so should not need to be overridden.
2023-03-29 01:32:10 +02:00
Paul Eggert 76eba39472 assert-h: port static_assert to strict C99
* lib/verify.h (_GL_VERIFY): Port MSVC hack back to C99.
Problem found when testing bleeding-edge gzip on IBM XL C for AIX,
V12.1 (5765-J02, 5725-C72), which complained ‘"malloca.c", line
42.56: 1506-041 (E) The invocation of macro _Static_assert
contains fewer arguments than are required by the macro
definition.’  This diagnostic is valid because C99 requires
that if you #define _Static_assert(R, ...) you must call
_Static_assert with at least two arguments.  I found a similar
problem with Sun C 5.9 SunOS_sparc Patch 124867-12 2009/11/22.
2023-01-01 10:27:38 +01:00
Bruno Haible 8a4e73687a Fix compilation errors in C++ mode on Solaris 11 OpenIndiana.
* m4/gnulib-common.m4 (gl_COMMON_BODY): In _GL_ATTRIBUTE_DEALLOC_FREE,
with GNU C++, cast the 'free' function.
* lib/string.in.h (_GL_ATTRIBUTE_DEALLOC_FREE): With GNU C++, cast the
'free' function.
* lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC_FREE): Likewise.
2023-01-01 10:23:10 +01:00
Paul Eggert b4bc96ce7a stdbool-c99: fix typo
Reported against Autoconf by Todd C. Miller in:
https://lists.gnu.org/r/autoconf/2022-12/msg00001.html
* m4/stdbool.m4 (AC_CHECK_HEADER_STDBOOL): Sync from Autoconf master.
2023-01-01 10:20:55 +01:00
Paul Eggert 30c0d5e14a posix_spawnp-tests: fix filename typo
Problem reported for GNU m4 by Mitchell Dorrell in:
https://lists.gnu.org/r/bug-m4/2022-12/msg00000.html
* tests/test-posix_spawnp-script.c (DATA_FILENAME):
Fix typo in file name that caused race with
test-posix_spawn-script.c.
2023-01-01 10:20:01 +01:00
Paul Eggert 3011f799b1 explicit_bzero: add poison
* m4/string_h.m4 (gl_STRING_H): Poison explicit_bzero.
This was inadvertently omitted when explicit_bzero was added.
2023-01-01 10:19:19 +01:00
Paul Eggert f74ecfd735 explicit_bzero: work with gcc -std=c99
* lib/explicit_bzero.c (explicit_bzero) [__GNUC__ && !__clang__]:
Use __asm__ instead of asm.
2023-01-01 10:18:19 +01:00
Bruno Haible c5f6a918c6 posix_spawn tests: Fix compilation error (regression 2022-09-14).
* modules/posix_spawn-tests (Makefile.am): Augment DEFS, to define
EXEEXT.
2023-01-01 10:17:26 +01:00
Simon Josefsson 9bfcea6dce vc-list-files-tests: Avoid OpenPGP private key operations.
* tests/test-vc-list-files-git.sh (GIT_CONFIG_GLOBAL): Set it to /dev/null.
2023-01-01 10:16:32 +01:00
Simon Josefsson 3ac3afc946 maintainer-makefile: Fix last sc_indent commit.
* top/maint.mk (sc_indent): Don't use grep -q.
Suggested by Bruno Haible.
2023-01-01 10:15:55 +01:00
Simon Josefsson e485da2e35 maintainer-makefile: Fix Apple Xcode 'make syntax-check'.
* top/maint.mk (sc_indent): Don't use non-GNU indent.
2023-01-01 10:15:31 +01:00
Bruno Haible 5a5b4e9562 getdelim: Work around buggy implementation on macOS 10.13.
* doc/posix-functions/getdelim.texi: Mention the macOS bug.
* m4/getdelim.m4 (gl_FUNC_GETDELIM): Let the "checking for working
getdelim function" test answer 'no' on macOS.
2023-01-01 10:13:49 +01:00
Karl Berry 12a7795f49 autoupdate 2023-01-01 10:10:04 +01:00
Daiki Ueno 7eaad50a7b largefile: fix detection of time_t size on mingw32
* modules/largefile (configure.ac-early): Ensure gl_YEAR2038_EARLY
is invoked before gl_YEAR2038_BODY.
2023-01-01 10:10:04 +01:00
Paul Eggert a41b6f260c fts: fix errno handling if dirfd fails
* lib/fts.c (fts_build): Use proper errno if dirfd failed.
Although I don’t know of any platform where dirfd can fail here,
we might as well get it right.
2023-01-01 10:10:04 +01:00
Bruno Haible 1239f24134 stdalign: Fix compilation error with MSVC in C++ mode.
* lib/stdalign.in.h: Treat MSVC in C++ mode like C++11 compliant
compilers.
2023-01-01 10:10:04 +01:00
Karl Berry a40f443f53 autoupdate 2023-01-01 10:10:04 +01:00
Bruno Haible 9824c34ff9 snippet/warn-on-use: Don't cause wrong AC_CHECK_DECL results with clang.
* m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Use the clang command-line
option that disables implicit built-in function declarations in clang.
2022-09-20 23:57:48 +02:00
Bruno Haible a4b48765cb stdbool tests: Fix compilation error with clang/MSVC.
* tests/test-stdbool.c (WORKING_BOOL): Define to 0 on compilers that
define _MSC_VER.
2022-09-20 23:57:06 +02:00
Bruno Haible 64b2b36762 stdbool: Ensure that 'true' can be used in the preprocessor.
* lib/stdbool.in.h (true): Redefine if it does not evaluate to 1 in the
preprocessor.
2022-09-18 21:24:36 +02:00
Bruno Haible a945847ddc signal: Fix a C++ compilation error due to sched_yield on OpenBSD 6.0.
* lib/signal.in.h: On OpenBSD, include <sys/param.h>. Don't include
<pthread.h> on OpenBSD ≥ 5.1.
2022-09-18 21:23:14 +02:00
Bruno Haible 0aa9706f9e wchar: Fix compilation errors in C++ mode on Solaris 11.3.
* lib/wchar.in.h (wcsnlen, wcpcpy, wcpncpy, wcscasecmp, wcsncasecmp,
wcsdup): Force declaration in C++ mode on Solaris (which does not
declare these functions in the global namespace).
2022-09-18 21:22:41 +02:00
Bruno Haible 50bcc90faa swab: Fix compilation error with Sun C++ on Solaris 11.3.
* lib/unistd.in.h (swab): For the C++ declaration, under Solaris 11 but
not under Solaris 10, test also __XOPEN_OR_POSIX.
2022-09-18 21:22:29 +02:00
Bruno Haible 234d1d7ae9 time C++ tests: Fix link error on CentOS 5.
* modules/time-c++-tests (Makefile.am): Link test-time-c++ against
$(LIB_CLOCK_GETTIME).
2022-09-18 21:22:21 +02:00
Bruno Haible 0152675d8e time: Fix compilation errors with clang/MSVC.
* m4/time_h.m4 (gl_TIME_H): Test whether asctime_r and ctime_r are
declared.
* lib/time.in.h (asctime_r, ctime_r): Skip _GL_WARN_ON_USE invocations
when these functions are not declared.
2022-09-18 21:21:43 +02:00
Bruno Haible df043f4541 verify: Avoid syntax error due to static_assert with clang in C++ mode.
* lib/verify.h (static_assert): Don't define in clang C++ 6 or newer.
2022-09-18 21:20:34 +02:00
Bruno Haible 1493d76c9f verify: Avoid syntax error due to static_assert with MSVC 14 in C++.
* lib/verify.h (static_assert): For MSVC in C++ mode, use a definition
that supports both the two-arguments and the one-argument syntax.
2022-09-18 21:17:11 +02:00
Bruno Haible 30e05eca5e posix_spawn-* tests: Fix test failure on mingw when libtool is in use.
* tests/test-posix_spawn-inherit0.c (CHILD_PROGRAM_FILENAME): Add the
EXEEXT suffix.
* tests/test-posix_spawn-inherit1.c (CHILD_PROGRAM_FILENAME): Likewise.
* tests/test-posix_spawn-open1.c (CHILD_PROGRAM_FILENAME): Likewise.
* tests/test-posix_spawn-open2.c (CHILD_PROGRAM_FILENAME): Likewise.
2022-09-18 21:15:14 +02:00
Bruno Haible 678ea42096 verify: Avoid syntax error due to static_assert with MSVC 14.
* lib/verify.h (_Static_assert): Pass only the first argument to
_GL_VERIFY.
2022-09-18 21:14:35 +02:00
Bruno Haible 8850ea37e4 verify: Avoid syntax error due to static_assert with GNU C++ 6.x.
* lib/verify.h (static_assert): Don't define in GNU C++ 6 or newer.
2022-09-18 21:12:52 +02:00
Bruno Haible 3f7d4c77e8 supersede: Avoid a failure when writing to /dev/null in Solaris zones.
* lib/supersede.c (open_supersede): Treat EACCES (seen on Solaris 11.3)
like EINVAL (seen on Illumos).
2022-09-12 10:53:06 +02:00
Bruno Haible dc631883e4 Revert two "Sync with GNU gettext" commits. 2022-09-11 15:22:21 +02:00
Bruno Haible 17394c80c6 pipe-filter-gi: Fix test failure on native Windows.
* lib/pipe-filter-aux.h (write): Redefine on native Windows.
2022-09-11 02:59:05 +02:00
Bruno Haible a8b163a0fe stdbool C++ tests: Fix for C++20.
* tests/test-stdbool-c++2.cc: Don't include <cstdbool> in C++20 or
newer.
2022-09-11 02:58:37 +02:00
Bruno Haible 1c36763093 uchar: Work around error in C++ mode on AIX 7.2 with xlclang.
* lib/uchar.in.h (char16_t, char32_t): On AIX with xlclang++, define
these as macros.
* doc/posix-headers/uchar.texi: Document the AIX + xlclang++ bug.
2022-09-11 02:58:27 +02:00
Bruno Haible 0c7fab6818 string: Fix compilation error in C++ mode on AIX 7.2 with xlclang.
* lib/string.in.h (mbslen): Enable the C++ alias warning only on glibc
systems.
2022-09-11 02:57:56 +02:00
Bruno Haible d7c2a92db8 math: Fix compilation error in C++ mode on AIX 7.2 with xlclang.
* lib/math.in.h (cbrtl, copysignl, exp2l, expm1l, fmal, ilogbl, log1pl,
log2l, logbl, remainderl, rintl, roundl, truncl): Enable the C++ alias
warning only on glibc systems.
2022-09-11 02:57:44 +02:00
Bruno Haible 40f62251c7 posix_spawn-internal: Don't lose flags while duplicating an fd.
* lib/spawni.c (do_dup2): Fix the flags of the new fd.
2022-09-10 03:03:35 +02:00
Bruno Haible 9ddf972ce1 spawn-pipe: Fix pipe-filter-* test hangs (regression 2020-12-24).
* lib/windows-spawn.h (struct inheritable_handles): Widen the per-fd
flags from 8 bits to 16 bits.
(KEEP_OPEN_IN_CHILD): New macro.
(init_inheritable_handles): Change description of what it does when
duplicate == true.
* lib/windows-spawn.c (init_inheritable_handles): If duplicate == true,
add all fds to the array, regardless whether they are scheduled to be
preserved in the child process.
(compose_handles_block): Update.
(spawnpvech): Update.
* lib/spawni.c (grow_inheritable_handles): Update.
(shrink_inheritable_handles): Also close the handles not marked with
KEEP_OPEN_IN_CHILD.
(do_open, do_dup2): Mark the new fd with KEEP_OPEN_IN_CHILD.
2022-09-10 03:03:20 +02:00
Bruno Haible 710b168cf4 spawn-pipe: Fix possible hangs in programs that spawn several children.
* lib/spawn-pipe.c (create_pipe) [Unix]: Create the ifd[] and ofd[] file
descriptors with the close-on-exec flag set.
2022-09-10 03:03:10 +02:00
Bruno Haible 6a91be2eb5 pipe-filter-gi tests: Fix long-standing failure on native Windows.
* tests/test-pipe-filter-gi2-main.c: Include binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
* tests/test-pipe-filter-gi2-child.c: Include <unistd.h>, binary-io.h.
(main): Avoid NL to CRLF conversion on standard output.
2022-09-10 03:03:03 +02:00
Bruno Haible bb06ae2bad posix_spawn_file_actions_addclose tests: Fix mistake from 2022-09-07.
* modules/posix_spawn_file_actions_addclose-tests (Files): Add
m4/musl.m4.
2022-09-10 03:02:45 +02:00
Bruno Haible 9e3c635584 posix_spawn_file_actions_addclose tests: Avoid test failure on musl.
Reported by Valery Ushakov <uwe@stderr.spb.ru> in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-09/msg00041.html>.

* modules/posix_spawn_file_actions_addclose-tests (configure.ac): Invoke
gl_MUSL_LIBC.
* tests/test-posix_spawn_file_actions_addclose.c (main): Skip one of the
tests on musl libc.
2022-09-10 03:02:07 +02:00
Karl Berry 9bc59b5ebe autoupdate 2022-09-10 03:01:30 +02:00
Bruno Haible 1c06c41acd pthread-h: Fix compilation error on mingw with --enable-threads=windows.
* lib/pthread.in.h: In C++ mode, if mingw's <pthread.h> has not been
used, import many pthread_* symbols from the GNULIB_NAMESPACE into the
global namespace.
2022-09-10 03:01:22 +02:00
Bruno Haible 2256fa05fa Fix various test link errors on MSVC.
* modules/crypto/gc-arcfour-tests (Makefile.am): Link test-gc-arcfour
with $(LIB_GETRANDOM).
* modules/crypto/gc-arctwo-tests (Makefile.am): Link test-gc-arctwo with
$(LIB_GETRANDOM).
* modules/crypto/gc-des-tests (Makefile.am): Link test-gc-des with
$(LIB_GETRANDOM).
* modules/crypto/gc-hmac-md5-tests (Makefile.am): Link test-gc-hmac-md5
with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha1-tests (Makefile.am): Link
test-gc-hmac-sha1 with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha256-tests (Makefile.am): Link
test-gc-hmac-sha256 with $(LIB_GETRANDOM).
* modules/crypto/gc-hmac-sha512-tests (Makefile.am): Link
test-gc-hmac-sha512 with $(LIB_GETRANDOM).
* modules/crypto/gc-md2-tests (Makefile.am): Link test-gc-md2 with
$(LIB_GETRANDOM).
* modules/crypto/gc-md4-tests (Makefile.am): Link test-gc-md4 with
$(LIB_GETRANDOM).
* modules/crypto/gc-md5-tests (Makefile.am): Link test-gc-md5 with
$(LIB_GETRANDOM).
* modules/crypto/gc-pbkdf2-tests (Makefile.am): Link test-gc-pbkdf2 with
$(LIB_GETRANDOM).
* modules/crypto/gc-pbkdf2-sha1-tests (Makefile.am): Link
test-gc-pbkdf2-sha1 with $(LIB_GETRANDOM).
* modules/crypto/gc-rijndael-tests (Makefile.am): Link test-gc-rijndael
with $(LIB_GETRANDOM).
* modules/crypto/gc-sha1-tests (Makefile.am): Link test-gc-sha1 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sha256-tests (Makefile.am): Link test-gc-sha256 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sha512-tests (Makefile.am): Link test-gc-sha512 with
$(LIB_GETRANDOM).
* modules/crypto/gc-sm3-tests (Makefile.am): Link test-gc-sm3 with
$(LIB_GETRANDOM).
* modules/sys_stat-c++-tests (Makefile.am): Link test-sys_stat-c++ with
$(LIB_GETRANDOM).
* modules/unistd-c++-tests (Makefile.am): Link test-unistd-c++ with
$(LIB_GETRANDOM).
2022-09-05 04:00:37 +02:00
Bruno Haible 7040c17a73 count-leading-zeros: Fix a link error on 32-bit MSVC and a test failure.
* lib/count-leading-zeros.h: Correct syntax for #pragma intrinsic.
(COUNT_LEADING_ZEROS): Fix the return value.
(count_leading_zeros_ll): Use two _BitScanReverse invocations instead
of a _BitScanReverse64 invocation.
2022-09-05 04:00:31 +02:00
Bruno Haible f44f8a6ac6 count-trailing-zeros: Fix a link error on 32-bit MSVC.
* lib/count-trailing-zeros.h: Correct syntax for #pragma intrinsic.
(count_trailing_zeros_ll): Use two _BitScanForward invocations instead
of a _BitScanForward64 invocation.
2022-09-05 04:00:26 +02:00
Bruno Haible 4c4e77befb unictype/category-none tests: Fix a link error on MSVC.
* tests/unictype/test-categ_none.c (main): Disable the test on MSVC.
2022-09-05 04:00:21 +02:00