Bruno Haible [Mon, 24 Apr 2023 10:48:31 +0000 (12:48 +0200)]
unicodeio tests: Avoid test failures on native Windows.
* tests/test-unicodeio.c: Include localcharset.h.
(main): Handle C locales whose encoding is CP1252 or similar.
* modules/unicodeio-tests (Depends-on): Add localcharset.
Bruno Haible [Thu, 20 Apr 2023 06:42:56 +0000 (08:42 +0200)]
assert-h, verify: Fix compilation error in C++ mode with MSVC 14.30.
* lib/verify.h (_Static_assert): In C++ mode with MSVC 14.1 or newer,
define merely to static_assert.
(static_assert): In C++ mode with MSVC 14.1 or newer, don't define.
Bruno Haible [Sat, 15 Apr 2023 16:05:57 +0000 (18:05 +0200)]
Fix compilation errors of list, set, oset, map, omap in C++ mode.
* m4/gnulib-common.m4 (gl_COMMON_BODY): Define
_GL_BRACKET_BEFORE_ATTRIBUTE. In _GL_ATTRIBUTE_DEPRECATED,
_GL_ATTRIBUTE_MAYBE_UNUSED, _GL_ATTRIBUTE_NODISCARD, don't use the
bracket syntax if _GL_BRACKET_BEFORE_ATTRIBUTE is defined.
backupfile: fix bug when renaming from subdirectory
* lib/backupfile.c (backup_internal): Ensure we use the
appropriate offset if operating on a subdirectory,
i.e., on an updated sdir.
Fixes https://bugs.gnu.org/62607
Paul Eggert [Sun, 25 Dec 2022 19:41:57 +0000 (11:41 -0800)]
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.
Paul Eggert [Tue, 9 Aug 2022 18:12:05 +0000 (11:12 -0700)]
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.
Jim Meyering [Thu, 23 Mar 2023 02:51:12 +0000 (19:51 -0700)]
gnu-web-doc-update: don't use host alias, cvs.sv.gnu.org
* build-aux/gnu-web-doc-update: Use hostname cvs.savannah.gnu.org,
not cvs.sv.gnu.org. Using the shorter alias would elicit this:
$ pkg=grep ; cvs -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg
Bad server host key: Invalid key length
Paul Eggert [Sun, 19 Mar 2023 23:06:34 +0000 (16:06 -0700)]
test-pselect, test-select: use different ports
I have observed rare and hard-to-reproduce problems with the GNU
grep release candidate with ‘make -j5 check’ on Fedora 37 x86-64.
One possibility is that test-pselect and test-select interfere
with each other somehow when run simultaneously, as they use the
same port. Work around this possibility by using different ports
from each other, and from test-poll (which also uses 12345).
Of course it’d be better if all these tests used system-assigned
ports, but I assume that’d take more work.
* tests/test-pselect.c, tests/test-select.c (TEST_PORT): New macro.
* tests/test-select.h (TEST_PORT): Remove.
Paul Eggert [Sun, 19 Feb 2023 06:05:24 +0000 (00:05 -0600)]
lseek: avoid SEEK_HOLE bugs in FreeBSD, macOS
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.
Bruno Haible [Thu, 2 Mar 2023 19:52:16 +0000 (20:52 +0100)]
mkfifoat: Fix crash on macOS 12.
* m4/gnulib-common.m4 (gl_PREPARE_CHECK_FUNCS_MACOS,
gl_CHECK_FUNCS_MACOS): New macros.
* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Test for mknodat and mkfifoat using
gl_CHECK_FUNCS_MACOS instead of AC_CHECK_FUNCS_ONCE.
Bruno Haible [Thu, 9 Feb 2023 12:30:04 +0000 (13:30 +0100)]
limits-h: Work around a clang 15 bug.
* m4/limits-h.m4 (gl_LIMITS_H): Test also for BOOL_MAX.
* lib/limits.in.h: Handle the case where BOOL_WIDTH is present and
BOOL_MAX is missing.
* doc/posix-headers/limits.texi: Mention the clang bug.
Bruno Haible [Tue, 7 Feb 2023 12:36:23 +0000 (13:36 +0100)]
Fix a copyright header - module license mismatch.
Reported by Bjarni Ingi Gislason <bjarniig@simnet.is> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00057.html>.
* lib/gen-uni-tables.c (output_predicate): For uniwidth/width2.h, use an
LGPLv2+ license.
(output_nonspacing_property): Use an LGPLv2+ license.
* lib/uniwidth/width0.h: Regenerated.
* lib/uniwidth/width2.h: Likewise.
Bruno Haible [Sun, 5 Feb 2023 16:20:50 +0000 (17:20 +0100)]
Update build-aux/po/Makefile.in.in.
Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2023-02/msg00020.html>.
* build-aux/po/Makefile.in.in: Sync from GNU gettext 0.21.1.
Fixes:
- In the .po -> .gmo rules, consider the newest changes to the POT file.
- Emit a warning when creating a tarball without POT file.
Bruno Haible [Sat, 4 Feb 2023 13:31:08 +0000 (14:31 +0100)]
assert-h, verify: Fix conflict with standard C++ header files on macOS.
* lib/verify.h (_Static_assert): Don't redefine with clang ≥ 3.8.0
in C++ mode.
* tests/test-assert-h-c++.cc: Also check against conflict with the
standard C++ header files.
* tests/test-assert-h-c++2.cc: Likewise.
Bruno Haible [Mon, 30 Jan 2023 11:30:21 +0000 (12:30 +0100)]
at-internal: Add support for z/OS.
Reported and draft patch by Igor Todorovski <itodorov@ca.ibm.com>.
* lib/openat-proc.c [z/OS]: Include <termios.h>.
(openat_proc_name): For z/OS, use an approach similar to kLIBC, with
3 lines of z/OS specific code by Igor Todorovski <itodorov@ca.ibm.com>.
Bruno Haible [Sat, 28 Jan 2023 10:52:40 +0000 (11:52 +0100)]
Avoid clang warnings regarding [[__nodiscard__]].
* m4/gnulib-common.m4 (gl_COMMON_BODY): For clang, in C++ mode, ignore
the __has_c_attribute value and define _GL_ATTRIBUTE_NODISCARD to
__attribute__ ((__warn_unused_result__)), not [[__nodiscard__]].
* m4/gnulib-common.m4 (gl_COMMON_BODY): For clang versions ≥ 6, < 10,
in C++ mode, ignore the __has_c_attribute value and define
_GL_ATTRIBUTE_MAYBE_UNUSED to __attribute__ ((__unused__)), not
[[__maybe_unused__]].
Bruno Haible [Wed, 25 Jan 2023 14:29:13 +0000 (15:29 +0100)]
stdalign: Fix a compilation error on FreeBSD 12.0.
* lib/stdalign.in.h (_Alignof): In C mode, prefer __builtin_offsetof
over offsetof when possible, since __builtin_offsetof works also when
<stddef.h> has not been fully included yet.
Paul Eggert [Sun, 22 Jan 2023 06:49:04 +0000 (00:49 -0600)]
sigsegv, vma-iter: port to Solaris 10
On this platform, <sys/types.h> does not define off_t if neither
_LP64 nor _FILE_OFFSET_BITS is defined, which can happen if we
of doing stdbool, since config.h now includes <stdbool.h>, and
Solaris 10 <stdbool.h> includes <sys/feature_tests.h> which
arranges for _FILE_OFFSET_BITS to always be defined (if only to 32),
which <sys/types.h> assumes.
* lib/stackvma.c, lib/vma-iter.c (_FILE_OFFSET_BITS) [__sun && !_LP64]:
Define to 32 instead of leaving undefined.
Paul Eggert [Fri, 20 Jan 2023 03:39:03 +0000 (19:39 -0800)]
snippet/_Noreturn: work around Clang _Noreturn bug
This is a bigger-hammer workaround for the clang _Noreturn issue
fix for dfa.c on 2023-01-01. Unfortunately, it causes 270
-Wreturn-type and -Wsometimes-uninitialized warnings when building
bleeding-edge GNU Emacs from Git on Fedora 37 with plain
‘./configure && make’. So the workaround is enabled only if you
compile with -D_GL_WORK_AROUND_LLVM_BUG_59792.
* lib/_Noreturn.h (_Noreturn):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
and if _GL_WORK_AROUND_LLVM_BUG_59792 is defined.
Bruno Haible [Tue, 17 Jan 2023 18:16:29 +0000 (19:16 +0100)]
fflush: Fix a buffer overrun on 32-bit Android.
* lib/stdio-impl.h (fp_): On Android, change the type of _offset to
'long'.
* lib/fflush.c (update_fpos_cache): On Android, update a 'long', not an
'fpos_t'.
Paul Eggert [Sun, 15 Jan 2023 00:47:41 +0000 (16:47 -0800)]
test-framework-sh: work around AIX 7.2 diff bugs
* tests/init.sh (compare_dev_null_): Run diff in the C locale.
AIX 7.2 diff messes up in UTF-8 locales; for example,
‘printf '\360\220\200\200\n' | diff - /dev/null’ incorrectly
outputs nothing and exits with status 0 when LC_ALL=en_US.UTF-8.
Paul Eggert [Fri, 13 Jan 2023 22:32:11 +0000 (14:32 -0800)]
verify: work around xlclang 16.1 compiler bug
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/grep-devel/2023-01/msg00003.html
* lib/verify.h (_GL_HAS_BUILTIN_TRAP, _GL_HAS_BUILTIN_UNREACHABLE):
Define to 0 if compiler advertises itself as clang before version 5.
xlclang 16.1 advertises itself as 4.0.1 and this patch works
around what appears to be a compiler bug when compiling dfa.c in
bleeding-edge grep.