Bruno Haible [Wed, 28 Jun 2023 16:28:23 +0000 (18:28 +0200)]
mbrtoc16: New module.
* lib/uchar.in.h (mbrtoc16): New declaration.
* lib/mbrtoc16.c: New file.
* m4/mbrtoc16.m4: New file, based on m4/mbrtoc32.m4.
* modules/mbrtoc16: New file.
* m4/uchar_h.m4 (gl_UCHAR_H): Test whether mbrtoc16 is declared.
(gl_UCHAR_H_REQUIRE_DEFAULTS): Initialize GNULIB_MBRTOC16.
(gl_UCHAR_H_DEFAULTS): Initialize HAVE_MBRTOC16, REPLACE_MBRTOC16.
* modules/uchar (Makefile.am): Substitute GNULIB_MBRTOC16,
HAVE_MBRTOC16, REPLACE_MBRTOC16.
* doc/posix-functions/mbrtoc16.texi: Mention the mbrtoc16 module and the
mbsinit related limitation.
* doc/posix-functions/mbsinit.texi: Mention the mbrtoc16 related
limitation.
Bruno Haible [Wed, 28 Jun 2023 10:35:21 +0000 (12:35 +0200)]
mbrtoc32: Doc tweak.
* doc/posix-functions/mbrtoc32.texi: Mention that mingw and Android have
the empty input bug.
* m4/mbrtoc32.m4 (gl_MBRTOC32_EMPTY_INPUT): Update cross-compilation
guess.
Bruno Haible [Wed, 28 Jun 2023 13:01:33 +0000 (15:01 +0200)]
mbrtowc: Doc tweak.
* doc/posix-functions/mbrtowc.texi: Mention that MSVC has the empty
input bug and the return value bug. Mention that Android has the empty
input bug.
* m4/mbrtowc.m4 (gl_MBRTOC32_EMPTY_INPUT): Update cross-compilation
guess.
Bruno Haible [Tue, 27 Jun 2023 09:28:26 +0000 (11:28 +0200)]
c32*: Optionally enforce ISO C 23 semantics of char32_t.
* lib/lc-charset-unicode.h: New file.
* lib/lc-charset-unicode.c: New file.
* modules/uchar-c23: New file.
* lib/uchar.in.h (char32_t): Add comment.
* lib/mbrtoc32.c: Include lc-charset-unicode.h.
(mbrtoc32): If char32_t is Unicode and wchar_t is not, invoke
locale_encoding_to_unicode.
* lib/btoc32.c: Include lc-charset-unicode.h.
(btoc32): If char32_t is Unicode and wchar_t is not, invoke
locale_encoding_to_unicode.
* lib/c32rtomb.c: Include lc-charset-unicode.h.
(c32rtomb): If char32_t is Unicode and wchar_t is not, invoke
unicode_to_locale_encoding.
* lib/c32tob.c: Include lc-charset-unicode.h.
(c32tob): If char32_t is Unicode and wchar_t is not, invoke
unicode_to_locale_encoding.
* lib/mbsnrtoc32s.c: If char32_t is Unicode and wchar_t is not, don't
use mbsnrtowcs.
* lib/mbsrtoc32s.c: If char32_t is Unicode and wchar_t is not, don't use
mbsrtowcs.
* lib/c32snrtombs.c: If char32_t is Unicode and wchar_t is not, don't
use wcsnrtombs.
* lib/c32srtombs.c: If char32_t is Unicode and wchar_t is not, don't use
wcsrtombs.
* lib/c32is-impl.h: Include lc-charset-unicode.h.
(FUNC): If char32_t is Unicode and wchar_t is not, use UCS_FUNC.
* lib/c32to-impl.h: Include lc-charset-unicode.h.
(FUNC): If char32_t is Unicode and wchar_t is not, use UCS_FUNC.
* lib/c32width.c: Include lc-charset-unicode.h.
(c32width): If char32_t is Unicode and wchar_t is not, use uc_width.
* tests/test-mbrtoc32.c: Include <wchar.h>.
(main): Skip GB18030 tests on NetBSD and Solaris. If
GL_CHAR32_T_IS_UNICODE, expect Unicode encoding for the char32_t values.
* tests/test-mbrtoc32-w32.c: Include <wchar.h>.
(test_one_locale): Simplify.
* tests/test-c32rtomb.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32rtomb.sh: Update.
* tests/test-mbsnrtoc32s.c: Include <wchar.h>.
(main): Skip GB18030 tests on NetBSD and Solaris.
* tests/test-mbsrtoc32s.c: Include <wchar.h>.
(main): Skip GB18030 tests on NetBSD and Solaris.
* tests/test-mbstoc32s.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32snrtombs.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32srtombs.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32stombs.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isalnum.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isalnum.sh: Update.
* tests/test-c32isalpha.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32isalpha.sh: Update.
* tests/test-c32isblank.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isblank.sh: Update.
* tests/test-c32iscntrl.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32iscntrl.sh: Update.
* tests/test-c32isdigit.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isdigit.sh: Update.
* tests/test-c32isgraph.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32isgraph.sh: Update.
* tests/test-c32islower.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32islower.sh: Update.
* tests/test-c32isprint.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32isprint.sh: Update.
* tests/test-c32ispunct.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32ispunct.sh: Update.
* tests/test-c32isspace.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isspace.sh: Update.
* tests/test-c32isupper.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isupper.sh: Update.
* tests/test-c32isxdigit.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32isxdigit.sh: Update.
* tests/test-c32tolower.c (main): Skip GB18030 tests on NetBSD and
Solaris.
* tests/test-c32tolower.sh: Update.
* tests/test-c32toupper.c (main): Skip GB18030 tests on NetBSD and
Solaris. Disable tests that would fail on macOS, FreeBSD, NetBSD,
Solaris.
* tests/test-c32toupper.sh: Update.
* modules/mbrtoc32 (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/mbrtoc32-tests (Makefile.am): Link test-mbrtoc32 with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/btoc32 (Link): New section.
* modules/btoc32-tests (Makefile.am): Link test-btoc32 with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32rtomb (Link): New section.
* modules/c32rtomb-tests (Makefile.am): Link test-c32rtomb with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32tob (Link): New section.
* modules/mbsnrtoc32s (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/mbsnrtoc32s-tests (Makefile.am): Link test-mbsnrtoc32s with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/mbsrtoc32s (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/mbsrtoc32s-tests (Makefile.am): Link test-mbsrtoc32s with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/mbstoc32s (Link): Add $(LIBUNISTRING) $(LIBC32CONV).
* modules/mbstoc32s-tests (Makefile.am): Link test-mbstoc32s with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32snrtombs (Link): New section.
* modules/c32snrtombs-tests (Makefile.am): Link test-c32snrtombs with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32srtombs (Link): New section.
* modules/c32srtombs-tests (Makefile.am): Link test-c32srtombs with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32stombs (Link): New section.
* modules/c32stombs-tests (Makefile.am): Link test-c32stombs with
$(LIBUNISTRING) $(LIBC32CONV).
* modules/c32isalnum (Link): Add $(LIBC32CONV).
* modules/c32isalnum-tests (Makefile.am): Link test-c32isalnum with
$(LIBC32CONV).
* modules/c32isalpha (Link): Add $(LIBC32CONV).
* modules/c32isalpha-tests (Makefile.am): Link test-c32isalpha with
$(LIBC32CONV).
* modules/c32isblank (Link): Add $(LIBC32CONV).
* modules/c32isblank-tests (Makefile.am): Link test-c32isblank with
$(LIBC32CONV).
* modules/c32iscntrl (Link): Add $(LIBC32CONV).
* modules/c32iscntrl-tests (Makefile.am): Link test-c32iscntrl with
$(LIBC32CONV).
* modules/c32isdigit (Link): Add $(LIBC32CONV).
* modules/c32isdigit-tests (Makefile.am): Link test-c32isdigit with
$(LIBC32CONV).
* modules/c32isgraph (Link): Add $(LIBC32CONV).
* modules/c32isgraph-tests (Makefile.am): Link test-c32isgraph with
$(LIBC32CONV).
* modules/c32islower (Link): Add $(LIBC32CONV).
* modules/c32islower-tests (Makefile.am): Link test-c32islower with
$(LIBC32CONV).
* modules/c32isprint (Link): Add $(LIBC32CONV).
* modules/c32isprint-tests (Makefile.am): Link test-c32isprint with
$(LIBC32CONV).
* modules/c32ispunct (Link): Add $(LIBC32CONV).
* modules/c32ispunct-tests (Makefile.am): Link test-c32ispunct with
$(LIBC32CONV).
* modules/c32isspace (Link): Add $(LIBC32CONV).
* modules/c32isspace-tests (Makefile.am): Link test-c32isspace with
$(LIBC32CONV).
* modules/c32isupper (Link): Add $(LIBC32CONV).
* modules/c32isupper-tests (Makefile.am): Link test-c32isupper with
$(LIBC32CONV).
* modules/c32isxdigit (Link): Add $(LIBC32CONV).
* modules/c32isxdigit-tests (Makefile.am): Link test-c32isxdigit with
$(LIBC32CONV).
* modules/c32tolower (Link): Add $(LIBC32CONV).
* modules/c32tolower-tests (Makefile.am): Link test-c32tolower with
$(LIBC32CONV).
* modules/c32toupper (Link): Add $(LIBC32CONV).
* modules/c32toupper-tests (Makefile.am): Link test-c32toupper with
$(LIBC32CONV).
* modules/c32width (Link): Add $(LIBC32CONV).
* modules/c32width-tests (Makefile.am): Link test-c32width with
$(LIBC32CONV).
* modules/c32swidth (Link): Add $(LIBC32CONV).
* modules/c32swidth-tests (Makefile.am): Link test-c32swidth with
$(LIBC32CONV).
* modules/mbchar (Link): Add $(LIBC32CONV).
* modules/mbiter (Link): Add $(LIBC32CONV).
* modules/mbuiter (Link): Add $(LIBC32CONV).
* modules/mbfile (Link): Add $(LIBC32CONV).
* modules/mbmemcasecmp (Link): Add $(LIBC32CONV).
* modules/mbmemcasecmp-tests (Makefile.am): Link test-mbmemcasecmp with
$(LIBC32CONV).
* modules/mbscasecmp (Link): Add $(LIBC32CONV).
* modules/mbscasecmp-tests (Makefile.am): Link test-mbscasecmp with
$(LIBC32CONV).
* modules/mbscasestr (Link): Add $(LIBC32CONV).
* modules/mbscasestr-tests (Makefile.am): Link test-mbscasestr1,
test-mbscasestr2, test-mbscasestr3, test-mbscasestr4 with $(LIBC32CONV).
* modules/mbschr (Link): Add $(LIBC32CONV).
* modules/mbschr-tests (Makefile.am): Link test-mbschr with
$(LIBC32CONV).
* modules/mbscspn (Link): Add $(LIBC32CONV).
* modules/mbscspn-tests (Makefile.am): Link test-mbscspn with
$(LIBC32CONV).
* modules/mbslen (Link): Add $(LIBC32CONV).
* modules/mbsncasecmp (Link): Add $(LIBC32CONV).
* modules/mbsncasecmp-tests (Makefile.am): Link test-mbsncasecmp with
$(LIBC32CONV).
* modules/mbsnlen (Link): Add $(LIBC32CONV).
* modules/mbspbrk (Link): Add $(LIBC32CONV).
* modules/mbspbrk-tests (Makefile.am): Link test-mbspbrk with
$(LIBC32CONV).
* modules/mbspcasecmp (Link): Add $(LIBC32CONV).
* modules/mbspcasecmp-tests (Makefile.am): Link test-mbspcasecmp with
$(LIBC32CONV).
* modules/mbsrchr (Link): Add $(LIBC32CONV).
* modules/mbsrchr-tests (Makefile.am): Link test-mbsrchr with
$(LIBC32CONV).
* modules/mbssep (Link): Add $(LIBC32CONV).
* modules/mbsspn (Link): Add $(LIBC32CONV).
* modules/mbsspn-tests (Makefile.am): Link test-mbsspn with
$(LIBC32CONV).
* modules/mbsstr (Link): Add $(LIBC32CONV).
* modules/mbsstr-tests (Makefile.am): Link test-mbsstr1, test-mbsstr2,
test-mbsstr3 with $(LIBC32CONV).
* modules/mbstok_r (Link): Add $(LIBC32CONV).
* modules/propername (Link): Add $(LIBC32CONV).
* modules/regex-quote (Link): Add $(LIBC32CONV).
* modules/regex-quote-tests (Makefile.am): Link test-regex-quote with
$(LIBC32CONV).
* modules/trim (Link): Add $(LIBC32CONV).
* modules/trim-tests (Makefile.am): Link test-trim with $(LIBC32CONV).
* modules/exclude (Link): Add $(LIBC32CONV).
* modules/exclude-tests (Makefile.am): Link test-exclude with
$(LIBC32CONV).
* doc/posix-headers/uchar.texi: Mention the uchar-c23 module.
* doc/posix-functions/mbrtoc32.texi: Likewise.
* doc/strings.texi (The char32_t type): Likewise.
Bruno Haible [Sun, 25 Jun 2023 18:18:41 +0000 (20:18 +0200)]
thread: Avoid compiler warnings on Solaris.
* lib/glthread/thread.h: Include <stdint.h>.
(gl_thread_self_pointer): Do the cast from pthread_t to 'void *' via
intptr_t.
* modules/thread (Depends-on): Add stdint.
Bruno Haible [Sun, 25 Jun 2023 17:11:26 +0000 (19:11 +0200)]
strerrorname_np: Add support for Solaris 11.4/sparc.
* lib/strerrorname_np.c (strerrorname_np): Consider ECKSUM, EFRAGS.
Allow ENOANO to be overloaded to another value.
* tests/test-strerrorname_np.c (main): Likewise.
Bruno Haible [Sun, 25 Jun 2023 16:19:06 +0000 (18:19 +0200)]
strerrorname_np: Work around glibc bug on PowerPC, SPARC systems.
* m4/strerrorname_np.m4 (gl_FUNC_STRERRORNAME_NP): Test also
strerrorname_np (EDEADLOCK).
* doc/glibc-functions/strerrorname_np.texi: Mention that glibc 2.36
still needs a workaround.
* lib/mbchar.h: Include <uchar.h> instead of <wchar.h>, <wctype.h>.
(struct mbchar): Use char32_t instead of wchar_t.
(mb_casecmp, mb_caseequal): Use c32tolower instead of towlower.
(mb_isalnum): Use c32isalnum instead of iswalnum.
(mb_isalpha): Use c32isalpha instead of iswalpha.
(mb_isblank): Use c32isblank instead of iswblank.
(mb_iscntrl): Use c32iscntrl instead of iswcntrl.
(mb_isdigit): Use c32isdigit instead of iswdigit.
(mb_isgraph): Use c32isgraph instead of iswgraph.
(mb_islower): Use c32islower instead of iswlower.
(mb_isprint): Use c32isprint instead of iswprint.
(mb_ispunct): Use c32ispunct instead of iswpunct.
(mb_isspace): Use c32isspace instead of iswspace.
(mb_isupper): Use c32isupper instead of iswupper.
(mb_isxdigit): Use c32isxdigit instead of iswxdigit.
(mb_width_aux): Use c32width, c32iscntrl instead of wcwidth, iswcntrl.
* lib/mbiter.h: Include <uchar.h> instead of <wchar.h>.
(mbiter_multi_next): Use mbrtoc32 instead of mbrtowc.
* lib/mbuiter.h: Include <uchar.h> instead of <wchar.h>.
(mbuiter_multi_next): Use mbrtoc32 instead of mbrtowc.
* lib/mbfile.h (mbfile_multi_getc): Use mbrtoc32 instead of mbrtowc.
* lib/mbscasestr.c (knuth_morris_pratt_multibyte, mbscasestr): Use
c32tolower instead of towlower.
* lib/exclude.c (string_hasher_ci): Use char32_t, c32tolower instead of
wchar_t, towlower.
* modules/mbchar (Depends-on): Add uchar, c32isalnum, c32isalpha,
c32isblank, c32iscntrl, c32isdigit, c32isgraph, c32islower, c32isprint,
c32ispunct, c32isspace, c32isupper, c32isxdigit, c32tolower, c32width.
Remove wchar, wctype-h, iswblank, iswdigit, iswxdigit, wcwidth.
* modules/mbiter (Depends-on): Add mbrtoc32, uchar. Remove mbrtowc,
wchar.
* modules/mbuiter (Depends-on): Likewise.
* modules/mbscasestr (Depends-on): Add c32tolower.
* modules/exclude (Depends-on): Add c32tolower.
* doc/strings.texi (C strings): Fix typo.
Paul Eggert [Tue, 20 Jun 2023 21:46:29 +0000 (14:46 -0700)]
doc: INSTALL uses UTF-8 now
* doc/Makefile (INSTALL.ISO, INSTALL.UTF-8):
Adjust to the fact that INSTALL now uses UTF-8.
INSTALL.UTF-8 is now obsolescent since it is identical.
(INSTALL.ISO): Transliterate all non-ASCII characters,
not just single quotes.
* doc/INSTALL.ISO: Regenerate.
Paul Eggert [Mon, 19 Jun 2023 21:08:06 +0000 (14:08 -0700)]
largefile: port to GNU/Linux alpha and s390x
This patch syncs from Autoconf master.
Problem reported by Matoro <https://bugs.gnu.org/64123>.
* lib/autoconf/specific.m4 (_AC_SYS_LARGEFILE_TEST_CODE):
New overridable macro FTYPE, to test types other than off_t.
(_AC_SYS_LARGEFILE_TEST_CODE): Test ino_t for
-D_FILE_OFFSETBITS=64 too, if no flags are needed for off_t.
Needed for GNU/Linux on alpha and s390x.
Bruno Haible [Mon, 19 Jun 2023 17:00:58 +0000 (19:00 +0200)]
doc: Use "spaced en dash" style instead of "spaced em dash" style.
Suggested by Paul Eggert.
* doc/gnulib.texi: At sentence level, use "spaced en dash" style instead
of "spaced em dash" style.
* doc/gnulib-intro.texi: Likewise.
* doc/multithread.texi: Likewise.
* doc/strings.texi: Likewise.
Bruno Haible [Sun, 18 Jun 2023 20:37:32 +0000 (22:37 +0200)]
configmake: Bypass the unusable 'echo' command of some shells.
Reported by Brian Inglis <Brian.Inglis@Shaw.ca> in
<https://lists.gnu.org/archive/html/bug-gettext/2023-06/msg00054.html>.
* m4/build-to-host.m4 (gl_BUILD_TO_HOST): Use 'printf' instead of
'echo', because the "dash" shell has a SystemV compatible 'echo'
command. Also, be sure to remove trailing CRs.
Paul Eggert [Sun, 18 Jun 2023 07:27:52 +0000 (00:27 -0700)]
Update \(en in copyright notices
* build-aux/update-copyright (ndash_re): New var, matching \(en too.
(stmt_remainder_re, stmt): Use it.
(stmt): Match year in constructs like "\(en2023".
(ndash): Now \(en in man pages.
Bruno Haible [Thu, 15 Jun 2023 06:38:48 +0000 (08:38 +0200)]
aligned-malloc, rmdir-errno: Sanitize configuration test result.
* m4/malloc-align.m4 (gl_MALLOC_ALIGNMENT): Don't put a newline at the
end of the conftest.out file.
* m4/rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Don't put a newline at the
end of the confdir2/errno file.
Bruno Haible [Mon, 12 Jun 2023 16:39:49 +0000 (18:39 +0200)]
vasnwprintf-posix: Work around another musl libc bug.
* m4/printf.m4 (gl_SWPRINTF_DIRECTIVE_LC): New macro.
* m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Invoke it, and set
NEED_WPRINTF_DIRECTIVE_LC if the %lc test failed.
* lib/vasnprintf.c (VASNPRINTF): If NEED_WPRINTF_DIRECTIVE_LC is set, do
the processing for %lc and %ls ourselves.
(local_wcslen): Update condition.
* doc/posix-functions/swprintf.texi: Mention the %lc problem.
Bruno Haible [Mon, 12 Jun 2023 14:48:03 +0000 (16:48 +0200)]
vasnwprintf-posix: Work around a musl libc bug.
* m4/vasnprintf.m4 (gl_PREREQ_VASNWPRINTF): Test also whether swprintf
in the C locale is free of encoding errors, and set
NEED_WPRINTF_DIRECTIVE_C if not.
* doc/posix-functions/swprintf.texi: Clarify the list of platforms for
the %c problem.
Bruno Haible [Mon, 12 Jun 2023 12:00:42 +0000 (14:00 +0200)]
warnings: Save memory and CPU time when inhibiting all warnings.
* m4/warnings.m4 (gl_WARN_ADD): Improve comments.
(gl_CC_INHIBIT_WARNINGS): Add also '-fno-analyzer' to
GL_CFLAG_INHIBIT_WARNINGS.
(gl_CXX_INHIBIT_WARNINGS): Add also '-fno-analyzer' to
GL_CXXFLAG_INHIBIT_WARNINGS.
* m4/javacomp.m4 (gt_JAVACOMP): Use option '-Xlint:-options' by default
and omit it only when it does not work.
* lib/javacomp.c (compile_using_javac): Add nowarn_option parameter.
(is_envjavac_usable): Add nowarn_option_out parameter. Use option
'-Xlint:-options' by default and omit it only when it does not work.
(is_javac_usable): Likewise.
(compile_java_class): Store the nowarn_option returned from
is_envjavac_usable and use it when invoking compile_using_envjavac.
Store the nowarn_option returned from is_javac_usable and use it when
invoking compile_using_javac.
Bruno Haible [Sun, 11 Jun 2023 01:13:29 +0000 (03:13 +0200)]
javacomp-script, javacomp: Add support for javac versions > 11.
Reported by Adrian Bunk <bunk-gnu@fs.tum.de> in
<https://savannah.gnu.org/bugs/?63385>.
* m4/javacomp.m4 (gt_JAVACOMP): When the java version is > 11, use that
version as target_version, not 11. When the java version is > 17, don't
warn. Remove goodcode, failcode variables. Don't bail out if the
source-version argument or the target-version argument is in the range
12..99. Use a heuristic that works with javac versions 11..20 at least.
Update comments.
* lib/javacomp.h (compile_java_class): State that source-version and
target-version may be larger than 11.
* lib/javacomp.c (default_target_version): Accommodate versions up to
99.
(SOURCE_VERSION_BOUND): Increase to 94.
(source_version_index): Accept versions up to 99.
(get_goodcode_snippet, get_failcode_snippet): Remove functions.
(TARGET_VERSION_BOUND): Increase to 94.
(target_version_index): Accept versions up to 99.
(corresponding_classfile_version): Remove function.
(execute_and_read_line): New function, based on lib/javaversion.c.
(get_compiler_version): New function.
(is_envjavac_usable): Add parameters source_option_out,
target_option_out. Use a heuristic that works with javac versions 11..20
at least. Call cleanup_temp_dir.
(is_javac_usable): Likewise.
(compile_java_class): Update.
Bruno Haible [Sun, 11 Jun 2023 01:13:24 +0000 (03:13 +0200)]
javacomp-script, javacomp: Remove support for javac versions < 1.6.
* m4/javacomp.m4 (gt_JAVACOMP): State that the minimum source_version
and the minimum target_version are 1.6. Map smaller values to 1.6.
Complain if the java version is < 1.6. Use 1.6 as default, instead of
1.1. Don't bother trying the -target option alone.
* lib/javacomp.h (compile_java_class): State that the minimum
source_version and the minimum target_version are 1.6.
* lib/javacomp.c (default_target_version): Complain if the java version
is < 1.6. Use 1.6 as default, instead of 1.1.
(SOURCE_VERSION_BOUND, source_version_index, get_goodcode_snippet,
get_failcode_snippet): Adjust to the new minimum source_version = 1.6.
(TARGET_VERSION_BOUND, target_version_index,
corresponding_classfile_version): Adjust to the new minimum
target_version = 1.6.
(get_source_version_for_javac): Remove function.
(is_envjavac_usable): Remove source_version_for_javac parameter. Don't
bother trying the -target option alone.
(is_javac_usable): Likewise.
(compile_java_class): Map source_version < 1.6 to 1.6. Map
target_version < 1.6 to 1.6. Use source_version instead of calling
get_source_version_for_javac.
Jim Meyering [Fri, 9 Jun 2023 17:15:30 +0000 (10:15 -0700)]
maint.mk: sc_prohibit_xalloc_without_use: also match alloc_die
* top/maint.mk (sc_prohibit_xalloc_without_use):
Adjust in-comment command's regexp so it also finds alloc_die,
whose declaration has a prefix of "_Noreturn" .
Also delete some now-obsolete commentary.
(_xa1): Regenerate the regexp using that command.
Reported by Pádraig Brady in
<https://lists.gnu.org/r/bug-gnulib/2023-06/msg00062.html>.
Paul Eggert [Fri, 9 Jun 2023 18:13:19 +0000 (11:13 -0700)]
xalloc-die: omit /*extern*/
* lib/xalloc.h (xalloc_die): Omit leading "/*extern*/".
It complicates syntax checking; see:
https://lists.gnu.org/r/bug-gnulib/2023-06/msg00062.html
Plus, it’s inconsistent style: the other function declarations in
xalloc.h don’t use ‘extern’. (I’m not a fan of using ‘extern’ when
it’s just noise, as is the case here.)
Bruno Haible [Fri, 9 Jun 2023 14:08:18 +0000 (16:08 +0200)]
javacomp-script: Remove support for 'jikes'.
* build-aux/javacomp.sh.in: Don't test HAVE_JIKES.
* m4/javacomp.m4 (gt_JAVACOMP): Don't set HAVE_JIKES. Don't set
CONF_JAVAC to 'jikes'. Update comment.
(gt_JAVACOMP_DISABLED): Don't set HAVE_JIKES.
Bruno Haible [Fri, 9 Jun 2023 13:29:01 +0000 (15:29 +0200)]
javacomp-script: Remove support for 'gcj'.
* build-aux/javacomp.sh.in: Don't test HAVE_GCJ_C.
* m4/javacomp.m4 (gt_JAVACOMP): Don't set HAVE_GCJ_C. Don't test whether
$JAVAC is gcj. Don't set CONF_JAVAC to 'gcj -C'. Update comment.
(gt_JAVACOMP_DISABLED): Don't set HAVE_GCJ_C.
Bruno Haible [Fri, 9 Jun 2023 13:14:52 +0000 (15:14 +0200)]
javaexec-script: Remove support for 'gij'.
* build-aux/javaexec.sh.in: Don't test HAVE_GIJ.
* m4/javaexec.m4 (gt_JAVAEXEC): Don't set HAVE_GIJ. Don't set CONF_JAVA
to 'gij'.
* m4/javacomp.m4: Update comment.
Bruno Haible [Fri, 9 Jun 2023 12:56:49 +0000 (14:56 +0200)]
javaexec-script: Remove support for 'jview'.
* build-aux/javaexec.sh.in: Don't test HAVE_JVIEW.
* m4/javaexec.m4 (gt_JAVAEXEC): Don't set HAVE_JVIEW. Don't set
CONF_JAVA to 'jview'.
(gt_JAVAEXEC_DISABLED): Don't set HAVE_JVIEW.
* m4/javacomp.m4: Update comment.
Paul Eggert [Thu, 8 Jun 2023 21:53:51 +0000 (14:53 -0700)]
Spelling fixes
Most of these were reported by Josh Soref <jsoref@gmail.com> in:
https://lists.gnu.org/r/bug-gnulib/2023-06/msg00057.html
except that some are omitted because the original is OK (e.g.,
"obsolescent"), and some are omitted because they are upstream
files and I've fixed them upstream or have filed bug reports,
and I made a few nearby corrections to grammar.
Paul Eggert [Tue, 6 Jun 2023 05:04:37 +0000 (22:04 -0700)]
copy-file-range: support building for older kernels
* m4/copy-file-range.m4 (gl_FUNC_COPY_FILE_RANGE):
Remove static check, to support the dubious practice of
building for platforms that predate the build platform.
On working kernels this adds an extra syscall the first time
that copy_file_range is used. Problem reported for Gentoo by
Sam James <https://bugs.gnu.org/63850>.
Paul Eggert [Mon, 5 Jun 2023 20:16:22 +0000 (13:16 -0700)]
manywarnings: more nuance about optimization
* doc/manywarnings.texi (manywarnings): Suggest compiling with the
optimization flags commonly used, as opposed to -O2 and -O0
specificially. -ggdb shouldn’t affect warnings so don’t mention it.
Bruno Haible [Mon, 5 Jun 2023 09:15:37 +0000 (11:15 +0200)]
Fix bugs on mingw when module dirfd is in use (regression 2023-04-26).
* lib/getcwd.c: When GNULIB_defined_DIR, revert to the system's
definitions of opendir, closedir, readdir, rewinddir.
* lib/mountlist.c: When GNULIB_defined_DIR, revert to the system's
definitions of opendir, closedir, readdir.
* lib/scandir.c: Likewise.
* lib/glob.c: Fix comment. When GNULIB_defined_DIR, don't undefine
opendir, closedir.
Bruno Haible [Sun, 4 Jun 2023 22:16:40 +0000 (00:16 +0200)]
manywarnings: Overhaul documentation.
* doc/manywarnings.texi: In the example, put all unwanted warning
options into 'nw', and use a second gl_MANYWARN_COMPLEMENT invocation to
sort out how these options need to get added to WARN_FLAGS.
Describe the first-time use in more detail: Recommend a new GCC.
Recommend to test builds with -O2 and with -O0. Suggest to sort the
warning by warning option. Add reference to the GCC pragma's
documentation.
Bruno Haible [Sun, 4 Jun 2023 17:27:48 +0000 (19:27 +0200)]
error: Fix support for library namespacing (regression 2023-05-27).
* lib/error.in.h (error): If error is defined as a macro, define a
static inline function _gl_inline_error that invokes it, and let the
new error macro invoke that function.
(error_at_line): If error_at_line is defined as a macro, define a static
inline function _gl_inline_error_at_line that invokes it, and let the
new error_at_line macro invoke that function.
Paul Eggert [Sat, 3 Jun 2023 05:30:52 +0000 (22:30 -0700)]
error: do not evaluate status twice
Do this in a different way, so that the status is evaluated
once even when not optimizing and when using GCC.
* lib/error.in.h (__gl_error_call1) [__GNUC__]: New macro.
(__gl_error_call) [__GNUC__]: Use it.
Bruno Haible [Fri, 2 Jun 2023 21:41:47 +0000 (23:41 +0200)]
warnings: Add ability to inhibit all warnings.
* m4/warnings.m4 (gl_CC_INHIBIT_WARNINGS, gl_CXX_INHIBIT_WARNINGS): New
macros, based on gl_CC_ALLOW_WARNINGS and gl_CXX_ALLOW_WARNINGS in
m4/gnulib-common.m4.
Paul Eggert [Fri, 2 Jun 2023 21:02:53 +0000 (14:02 -0700)]
propername-lite: new module
propername_lite acts like propername_utf8 but needs less
infrastructure, e.g., it does not worry about memory allocation.
* MODULES.html.sh (func_all_modules): Mention it.
* lib/propername.h (proper_name_lite): New decl.
* lib/propername-lite.c, modules/propername-lite: New files.
* pygnulib/GLEmiter.py (GLEmiter.po_Makevars):
Treat proper_name_lite like proper_name_utf8.
* lib/javacomp.c: Include verify.h.
(is_envjavac_gcj43_usable, is_envjavac_oldgcj_14_13_usable,
is_envjavac_nongcj_usable, compile_java_class): Assert that the
xasprintf results are non-NULL. This is possible since all involved
format strings are valid and don't use %ls, and all argument strings
are small compared to INT_MAX.
* modules/javacomp (Depends-on): Add verify.