]> git.ipfire.org Git - thirdparty/gettext.git/log
thirdparty/gettext.git
22 months agoxgettext: Perl: Avoid unbounded nesting_depth growth, part 1.
Bruno Haible [Mon, 18 Sep 2023 14:18:23 +0000 (16:18 +0200)] 
xgettext: Perl: Avoid unbounded nesting_depth growth, part 1.

* gettext-tools/src/x-perl.c: Return from extract_balanced when a semicolon
outside parentheses is seen.
(extract_balanced): Add parameters semicolon_delim, eat_semicolon_delim.
All callers changed.

Test case:
=================
use strict;
=================

22 months agoxgettext: Perl: Add ability to debug the nesting_depth.
Bruno Haible [Sun, 17 Sep 2023 15:37:25 +0000 (17:37 +0200)] 
xgettext: Perl: Add ability to debug the nesting_depth.

* gettext-tools/src/x-perl.c (DEBUG_NESTING_DEPTH): New macro.
(extract_balanced): Use it.

22 months agoxgettext: Perl: Refactor.
Bruno Haible [Sun, 17 Sep 2023 15:31:23 +0000 (17:31 +0200)] 
xgettext: Perl: Refactor.

* gettext-tools/src/x-perl.c: Reindent all '#if DEBUG_PERL' lines.

22 months agobuild: Fix "make install" failure on Android.
Bruno Haible [Sun, 17 Sep 2023 19:11:09 +0000 (21:11 +0200)] 
build: Fix "make install" failure on Android.

This patch fixes two problems with "make install" on Android:

1) On this platform, libtool is configured to relink libraries during
"make install".
This leads to a problem during the installation of libgettextsrc: The relink
command that libtool emits has the form

  $CC -shared -fPIC -DPIC .libs/*.o -L$(libdir) ... -lgettextlib ... \
      -o .libs/libgettextsrc-@VERSION@.soT

The option -lgettextlib resolves to $(libdir)/libgettextlib.a, not to
$(libdir)/libgettextlib-@VERSION@.so.
Thus the linker attempts to include many object files from libgettextlib.a
into libgettextsrc-@VERSION@.soT, but some of these reference global variables
in a non-PIC way, and the linker thus complains

  ld.lld: error: relocation R_ARM_REL32 cannot be used against symbol 'program_name'; recompile with -fPIC

2) The installed executables don't have a RUNPATH property that points to the
directory that contains the shared libraries. Thus these executables don't run.

Reported at <https://savannah.gnu.org/patch/index.php?10393>.

* m4/libtool.m4: On Android, fix library_names_spec and
hardcode_libdir_flag_spec.

22 months agoxgettext: Avoid error 'present charset "CHARSET" is not a portable encoding name...
Bruno Haible [Sat, 16 Sep 2023 22:18:47 +0000 (00:18 +0200)] 
xgettext: Avoid error 'present charset "CHARSET" is not a portable encoding name' when possible.

Reported by Arsen Arsenović <arsen@aarsen.me>
at <https://savannah.gnu.org/bugs/?64490>.

This changes the behaviour back to the one from gettext 0.21.1, where this
xgettext invocation produced just a warning.

* gettext-tools/src/msgl-iconv.c (iconv_message_list_internal): Don't give an
error when a PO file has a header entry with charset=CHARSET and is entirely
ASCII.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Likewise.
* gettext-tools/tests/xgettext-combine-1: New file.
* gettext-tools/tests/xgettext-combine-2: New file.
* gettext-tools/tests/xgettext-combine-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

22 months agolibgettextpo: Fix compilation error on Android.
Bruno Haible [Sat, 16 Sep 2023 15:49:23 +0000 (17:49 +0200)] 
libgettextpo: Fix compilation error on Android.

* gettext-tools/libgettextpo/gettext-po.c: Include error.h second.
(orig_error, orig_error_at_line): New variables.
(error, error_at_line): Undefine afterwards.
(po_file_read_v2, po_file_write, po_error_logger, po_message_check_format): Use
these variables instead of the error, error_at_line symbols.

22 months agointl: Don't export the symbol 'rpl_isnanf' on MSVC.
Bruno Haible [Fri, 15 Sep 2023 21:15:19 +0000 (23:15 +0200)] 
intl: Don't export the symbol 'rpl_isnanf' on MSVC.

* gettext-runtime/intl/configure.ac: Define rpl_isnanf to _libintl_isnanf.

22 months agointl: Don't export the symbol 'mbszero' on Windows platforms.
Bruno Haible [Fri, 15 Sep 2023 21:12:34 +0000 (23:12 +0200)] 
intl: Don't export the symbol 'mbszero' on Windows platforms.

* gettext-runtime/intl/configure.ac: Define mbszero to _libintl_mbszero.

22 months agointl: Fix a build error on Android.
Bruno Haible [Fri, 15 Sep 2023 18:54:32 +0000 (20:54 +0200)] 
intl: Fix a build error on Android.

The declaration in Android's <math.h>
  long double frexpl(long double, int*) __RENAME_LDBL(frexp, 3, 21);
has the effect that frexpl.o defines the symbol _libintl_frexp, not
_libintl_frexpl, if config.h contains
  #define frexp _libintl_frexp
  #define frexpl _libintl_frexpl

* gettext-runtime/intl/configure.ac:
If REPLACE_FREXP is 1, don't redirect frexp to _libintl_frexp.
If REPLACE_FREXPL is 1, don't redirect frexpl to _libintl_frexp.

22 months agointl: Don't export symbols from static MSVC .obj files.
Bruno Haible [Wed, 6 Sep 2023 18:59:03 +0000 (20:59 +0200)] 
intl: Don't export symbols from static MSVC .obj files.

* gettext-runtime/intl/intl-compat.c (DLL_EXPORTED): Set to empty on MSVC when
DLL_EXPORT is not defined.
* gettext-runtime/intl/printf.c (DLL_EXPORTED): Likewise.
* gettext-runtime/intl/setlocale.c (DLL_EXPORTED): Likewise.

22 months agoUpdate the installation instructions for Windows.
Bruno Haible [Thu, 29 Jun 2023 13:19:10 +0000 (15:19 +0200)] 
Update the installation instructions for Windows.

* INSTALL.windows: Add a note about MSYS2.

2 years agoUpdate release steps.
Bruno Haible [Sat, 17 Jun 2023 13:54:48 +0000 (15:54 +0200)] 
Update release steps.

2 years agoRelease 0.22 v0.22
Bruno Haible [Sat, 17 Jun 2023 12:21:09 +0000 (14:21 +0200)] 
Release 0.22

2 years agoUpdate release steps.
Bruno Haible [Sat, 17 Jun 2023 10:59:46 +0000 (12:59 +0200)] 
Update release steps.

2 years agoexamples: Use infrastructure from gettext version 0.22.
Bruno Haible [Thu, 15 Jun 2023 23:49:32 +0000 (01:49 +0200)] 
examples: Use infrastructure from gettext version 0.22.

* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 0.22.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.
* gettext-tools/examples/hello-*/m4/Makefile.am: Update .m4 file list.
* gettext-tools/examples/hello-*/autoclean.sh: Likewise.

2 years agoUpdate translations from TP.
Bruno Haible [Thu, 15 Jun 2023 18:40:13 +0000 (20:40 +0200)] 
Update translations from TP.

* gettext-runtime/po/*.po: Update from TP.
* gettext-runtime/po/LINGUAS: Add ka.
* gettext-tools/po/*.po: Update from TP.
* gettext-tools/po/LINGUAS: Add hr.
* gettext-tools/examples/po/*.po: Update from TP.

2 years agoPrepare for 0.22 release.
Bruno Haible [Thu, 15 Jun 2023 18:09:46 +0000 (20:09 +0200)] 
Prepare for 0.22 release.

* gettext-runtime/doc/matrix.texi: Update from TP.
* gettext-runtime/doc/nls.texi (STATUS): Update.
* gettext-runtime/intl/libgnuintl.in.h (LIBINTL_VERSION): Bump.
* gettext-tools/libgettextpo/gettext-po.in.h (LIBGETTEXTPO_VERSION): Bump.
* libtextstyle/version.sh: Update VERSION_NUMBER, RELEASE_DATE.
* gettext-runtime/po/Makefile.in.in: Bump Origin version.
* gettext-runtime/m4/gettext.m4: Update version at the first line.
* gettext-runtime/m4/intl.m4: Likewise.
* NEWS, libtextstyle/NEWS: Update.
* libtextstyle/lib/Makefile.am (LTV_*): Bump to 2:0:2.
* gettext-tools/libgettextpo/Makefile.am (LTV_*): Bump to 5:9:5.
* gettext-tools/emacs/po-mode.el (po-mode-version-string): Bump.
* gettext-tools/configure.ac (ARCHIVE_VERSION): Bump to 0.22.
* gettext-tools/misc/autopoint.in: Allow version 0.22.

2 years agoUpdate copyright year in --version output.
Bruno Haible [Thu, 15 Jun 2023 18:00:40 +0000 (20:00 +0200)] 
Update copyright year in --version output.

* gettext-runtime/src/envsubst.c (main): Update copyright year in --version
output.
* gettext-runtime/src/gettext.c (main): Likewise.
* gettext-runtime/src/ngettext.c (main): Likewise.
* gettext-runtime/src/gettext.sh.in (func_version): Likewise.
* gettext-tools/src/cldr-plurals.c (main): Likewise.
* gettext-tools/src/hostname.c (main): Likewise.
* gettext-tools/src/msgattrib.c (main): Likewise.
* gettext-tools/src/msgcat.c (main): Likewise.
* gettext-tools/src/msgcmp.c (main): Likewise.
* gettext-tools/src/msgcomm.c (main): Likewise.
* gettext-tools/src/msgconv.c (main): Likewise.
* gettext-tools/src/msgen.c (main): Likewise.
* gettext-tools/src/msgexec.c (main): Likewise.
* gettext-tools/src/msgfilter.c (main): Likewise.
* gettext-tools/src/msgfmt.c (main): Likewise.
* gettext-tools/src/msggrep.c (main): Likewise.
* gettext-tools/src/msginit.c (main): Likewise.
* gettext-tools/src/msgmerge.c (main): Likewise.
* gettext-tools/src/msgunfmt.c (main): Likewise.
* gettext-tools/src/msguniq.c (main): Likewise.
* gettext-tools/src/recode-sr-latin.c (main): Likewise.
* gettext-tools/src/urlget.c (main): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.
* gettext-tools/misc/autopoint.in (func_version): Likewise.
* gettext-tools/misc/convert-archive.in (func_version): Likewise.
* gettext-tools/misc/gettextize.in (func_version): Likewise.

2 years agoUpdate POTFILES.in.
Bruno Haible [Thu, 15 Jun 2023 15:19:25 +0000 (17:19 +0200)] 
Update POTFILES.in.

* gettext-runtime/po/POTFILES.in: Update.
* gettext-tools/po/POTFILES.in: Update.

2 years agointl: Fix translation lookup failure when wbindtextdomain is used.
Bruno Haible [Sat, 17 Jun 2023 08:49:04 +0000 (10:49 +0200)] 
intl: Fix translation lookup failure when wbindtextdomain is used.

Reported by Luca Bacci <luca.bacci@outlook.com> at
<https://savannah.gnu.org/bugs/index.php?64311>.

The bug showed up when a call to bindtextdomain() with an absolute directory
and a call to wbindtextdomain() for a different domain was in effect.
Translations in the first referenced domain worked, translations in the second
referenced domain did not.

* gettext-runtime/intl/loadinfo.h (struct loaded_l10nfile, _nl_make_l10nflist):
Improve comments.
* gettext-runtime/intl/finddomain.c (_nl_loaded_domains): Likewise.
* gettext-runtime/intl/l10nflist.c (_nl_make_l10nflist): Fix code that looks up
the loaded_l10nfile in the given list, and make it more maintainable.
* gettext-tools/tests/intl-6: Improve comments.
* gettext-tools/tests/intl-6-prg.c (main): Restructure.
* gettext-tools/tests/intl-7: New file, based on gettext-tools/tests/intl-6.
* gettext-tools/tests/intl-6-prg.c: New file, based on
gettext-tools/tests/intl-6-prg.c.
* gettext-tools/tests/Makefile.am (TESTS): Add intl-7.
(check_PROGRAMS): Add intl-7-prg.
(intl_7_prg_SOURCES, intl_7_prg_LDADD): New variables.

2 years agoAdd comments about tests that fail on Solaris derivatives.
Bruno Haible [Thu, 15 Jun 2023 15:04:12 +0000 (17:04 +0200)] 
Add comments about tests that fail on Solaris derivatives.

* gettext-tools/tests/msgmerge-compendium-6: Add comment about Solaris 11
derivatives.

2 years agoAdd comments about tests that fail on Alpine Linux.
Bruno Haible [Thu, 15 Jun 2023 15:03:19 +0000 (17:03 +0200)] 
Add comments about tests that fail on Alpine Linux.

* gettext-tools/tests/format-c-5: Add comment about musl libc.

2 years agoMake internationalization tests stricter on Solaris 11 systems.
Bruno Haible [Thu, 15 Jun 2023 15:00:56 +0000 (17:00 +0200)] 
Make internationalization tests stricter on Solaris 11 systems.

* gettext-tools/tests/format-c-5-prg.c (main): Don't expect an Arabic digit
output in a locale other than Farsi.
* gettext-tools/tests/format-c-5: Try an Arabic locale as well.

2 years agoFix a bug in the last commit.
Bruno Haible [Thu, 15 Jun 2023 21:33:50 +0000 (23:33 +0200)] 
Fix a bug in the last commit.

* gettext-tools/src/write-mo.c (write_table): Include the number of system
dependent string pairs in the computation of the hash table's size.
* gettext-tools/tests/msgfmt-20: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoMake translations of strings with <inttypes.h> macros work with musl libc.
Bruno Haible [Thu, 15 Jun 2023 07:47:15 +0000 (09:47 +0200)] 
Make translations of strings with <inttypes.h> macros work with musl libc.

* gettext-tools/src/write-mo.h (no_redundancy): New declaration.
* gettext-tools/src/write-mo.c (SIZEOF): New macro.
(no_redundancy): New variable.
(struct sysdep_instantiation_rule): New type.
(useful_instantiation_rules): New variable.
(concat_prefix_cs, get_sysdep_segment_value): New functions.
(write_table): Add a second pass, that instantiates system dependent string
pairs.
* gettext-tools/src/msgfmt.c (long_options): Add --no-redundancy.
(main): Handle the --no-redundancy option.
(usage): Document the --no-redundancy option.
* gettext-tools/doc/msgfmt.texi: Document the --no-redundancy option.
* gettext-tools/tests/msgfmt-12: Test the msgfmt result with and without
--no-redundancy.
* gettext-tools/tests/msgunfmt-2: Pass option --no-redundancy to msgfmt.
* NEWS: Mention the change.
* gettext-tools/tests/format-c-3: Include the redundant instantiations in the
expected result of msgunfmt.
* gettext-tools/tests/format-c-4: Likewise.

2 years agoSimplify code.
Bruno Haible [Thu, 15 Jun 2023 07:34:07 +0000 (09:34 +0200)] 
Simplify code.

* gettext-tools/src/locating-rule.c: Don't include mem-hash-map.h.

2 years agomem-hash-map: Fix a left-over from 2001-11-20.
Bruno Haible [Thu, 15 Jun 2023 07:30:44 +0000 (09:30 +0200)] 
mem-hash-map: Fix a left-over from 2001-11-20.

* gnulib-local/lib/mem-hash-map.h (hash_init): Fix comment.
* gnulib-local/lib/mem-hash-map.c (hash_init): Likewise.
* gettext-tools/src/msgl-fsearch.c (message_fuzzy_index_alloc): Don't test the
return value of hash_init.

2 years agoChange some tests to give more insights.
Bruno Haible [Wed, 14 Jun 2023 13:06:34 +0000 (15:06 +0200)] 
Change some tests to give more insights.

* gettext-tools/tests/format-c-3-prg.c (_): Remove macro.
(main): Test also a simple translation.
* gettext-tools/tests/format-c-4-prg.c: Likewise.
* gettext-tools/tests/format-c-5-prg.c: Likewise.
* gettext-tools/tests/format-c-3: Update.
* gettext-tools/tests/format-c-4: Likewise.
* gettext-tools/tests/format-c-5: Likewise.

2 years agoFix another system-tests failure on musl libc.
Bruno Haible [Wed, 14 Jun 2023 11:56:38 +0000 (13:56 +0200)] 
Fix another system-tests failure on musl libc.

* gettext-tools/tests/intl-3: With gettext from musl libc, use a different
expected output.

2 years agoAvoid the need for charset conversion at run time on musl libc.
Bruno Haible [Wed, 14 Jun 2023 11:56:24 +0000 (13:56 +0200)] 
Avoid the need for charset conversion at run time on musl libc.

This fixes 1 system-tests failure (intl-2) and 3 tests failures (lang-c,
lang-c++, lang-sh).

* gettext-tools/src/write-mo.h (no_convert_to_utf8): New declaration.
(msgdomain_write_mo): Add a 4th parameter.
* gettext-tools/src/write-mo.c: Include po-charset.h, msgl-iconv.h.
(no_convert_to_utf8): New variable.
(msgdomain_write_mo): Add a 4th parameter. Convert the message list to UTF-8.
* gettext-tools/src/msgfmt.c (long_options): Add --no-convert.
(main): Handle the --no-convert option. Pass a 4th argument to
msgdomain_write_mo.
(usage): Document the --no-convert option.
* gettext-tools/doc/msgfmt.texi: Document the --no-convert option.
* gettext-tools/doc/gettext.texi (MO Files): Document the character encoding of
strings in MO files.
* gettext-tools/tests/msgfmt-5: Use msgfmt option --no-convert.
* gettext-tools/tests/msgfmt-12: Likewise.
* gettext-tools/tests/lang-pascal: Likewise.
* NEWS: Mention the change.

2 years agoTrivial refactoring.
Bruno Haible [Wed, 14 Jun 2023 07:37:18 +0000 (09:37 +0200)] 
Trivial refactoring.

* gettext-tools/src/msgcmp.c (compare): Pass po_charset_utf8 to
iconv_msgdomain_list.
* gettext-tools/src/msgmerge.c (merge): Likewise.
* gettext-tools/src/xgettext.c (main): Likewise.

2 years agoMake internationalization tests stricter on musl systems.
Bruno Haible [Tue, 13 Jun 2023 23:43:50 +0000 (01:43 +0200)] 
Make internationalization tests stricter on musl systems.

* gettext-tools/m4/locale-de.m4 (gt_LOCALE_DE_UTF8): On musl systems, set
LOCALE_DE_UTF8 to "de_DE.UTF-8" instead of "none".

2 years agoUpdate after gnulib changed.
Bruno Haible [Thu, 15 Jun 2023 08:29:53 +0000 (10:29 +0200)] 
Update after gnulib changed.

2 years agoUpdate to the newest gnulib
Bruno Haible [Thu, 15 Jun 2023 08:26:11 +0000 (10:26 +0200)] 
Update to the newest gnulib

2 years agomsgfmt: Silence javac note "uses unchecked or unsafe operations".
Bruno Haible [Sun, 11 Jun 2023 22:45:35 +0000 (00:45 +0200)] 
msgfmt: Silence javac note "uses unchecked or unsafe operations".

* gettext-tools/src/write-java.c (write_java_code): Add template parameters to
Hashtable and Enumeration references.

2 years agoUpdate after gnulib changed.
Bruno Haible [Sun, 11 Jun 2023 01:41:53 +0000 (03:41 +0200)] 
Update after gnulib changed.

* NEWS: Mention the newly supported Java versions.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Sun, 11 Jun 2023 01:37:02 +0000 (03:37 +0200)] 
Update to the newest gnulib.

2 years agoFix Windows exports list regarding C++ format strings.
Bruno Haible [Fri, 9 Jun 2023 08:27:03 +0000 (10:27 +0200)] 
Fix Windows exports list regarding C++ format strings.

* gettext-tools/woe32dll/gettextsrc-exports.c: Add formatstring_cplusplus_brace.

2 years agoNew example 'hello-c++20'.
Bruno Haible [Fri, 9 Jun 2023 01:37:43 +0000 (03:37 +0200)] 
New example 'hello-c++20'.

* gettext-tools/examples/hello-c++20: New directory, based on
gettext-tools/examples/hello-c++.
* gettext-tools/examples/Makefile.am (EXAMPLESFILES, EXAMPLESDIRS): Update.
* gettext-tools/examples/po/Makefile.am (POTFILES, SMALLPOTS,
SMALLPOFILES_FOR_lang): Update.
(hello-c++20.pot, hello-c++20/po/$(LL).po): New rules.
* gettext-tools/examples/README: Update.
* gettext-tools/examples/check-examples (func_check_autoclean_all,
func_check_distclean_all, func_check_maintainerclean_all,
func_check_maintainerclean_vpath_all, func_check_dist_all,
func_check_dist_vpath_all, func_check_install_all, func_check_uninstall_all,
func_check_distcheck_all, func_check_all): Handle this directory as well.
* NEWS: Mention the new example.

2 years agoAdd support for C++ format strings.
Bruno Haible [Thu, 8 Jun 2023 18:41:14 +0000 (20:41 +0200)] 
Add support for C++ format strings.

* gettext-tools/src/message.h (enum format_type): New enum item
format_cplusplus_brace.
(NFORMATS): Increment.
* gettext-tools/src/message.c (format_language, format_language_pretty): Add
entries for format_cplusplus_brace.
* gettext-tools/src/format.h (formatstring_cplusplus_brace): New declaration.
* gettext-tools/src/format-c++-brace.c: New file, based on
gettext-tools/src/format-awk.c.
* gettext-tools/src/format.c (formatstring_parsers): Add an entry for
format_cplusplus_brace.
* gettext-tools/src/Makefile.am (FORMAT_SOURCE): Add format-c++-brace.c.
* gettext-tools/src/FILES: Update.
* gettext-tools/src/x-c.h (SCANNERS_C): In language C++, use
formatstring_cplusplus_brace as second format string parser.
* gettext-tools/src/x-c.c (init_flag_table_c): Initialize flags related to
c++-format.
* gettext-tools/src/xgettext.c (xgettext_record_flag): Handle
format_cplusplus_brace.
(recognize_qt_formatstrings, language_to_extractor): Update.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Update.
* gettext-tools/libgettextpo/Makefile.am (libgettextpo_la_AUXSOURCES): Add
format-c++-brace.c.
* gettext-tools/tests/format-c++-brace-1: New file, based on
gettext-tools/tests/format-c-1.
* gettext-tools/tests/format-c++-brace-2: New file, based on
gettext-tools/tests/format-c-2.
* gettext-tools/tests/lang-c++20: New file, based on
gettext-tools/tests/lang-c++.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
* gettext-tools/doc/gettext.texi (PO Files): Mention c++-format and
no-c++-format.
(Preparing strings): Add subheading "No programmer-defined format string
directives".
(Mark Keywords): Mention the need to use std::vformat instead of std::format.
(c++-format): New subsection.
* gettext-tools/doc/lang-c.texi: Mention the syntax for C++ format strings.
* NEWS: Mention the change.

tweak c++-format

2 years agoNEWS: Mention Unicode 15.
Bruno Haible [Thu, 8 Jun 2023 18:45:23 +0000 (20:45 +0200)] 
NEWS: Mention Unicode 15.

* NEWS: Mention that Unicode 15 is supported. Done in gnulib on 2022-10-16.

2 years agoSimplify format-c-1 test.
Bruno Haible [Thu, 8 Jun 2023 18:36:26 +0000 (20:36 +0200)] 
Simplify format-c-1 test.

* gettext-tools/tests/format-c-1: Remove a redundant test case.

2 years agoSimplify lang-c++ test.
Bruno Haible [Thu, 8 Jun 2023 13:00:47 +0000 (15:00 +0200)] 
Simplify lang-c++ test.

* gettext-tools/tests/lang-c++: Remove unneeded include.

2 years agoTweak comments.
Bruno Haible [Wed, 7 Jun 2023 23:30:24 +0000 (01:30 +0200)] 
Tweak comments.

2 years agoxgettext: Avoid side effects of the Vala extractor on the C extractor.
Bruno Haible [Wed, 7 Jun 2023 16:57:37 +0000 (18:57 +0200)] 
xgettext: Avoid side effects of the Vala extractor on the C extractor.

* gettext-tools/src/xgettext.h (xgettext_record_flag): Add more comments.
* gettext-tools/src/xgettext.c (xgettext_record_flag): Parse an optional
'!BACKEND' suffix. When present, limit the effects of c-format related flags to
the specified flag table(s).
* gettext-tools/src/x-vala.c (init_flag_table_vala): Append '!Vala' to all
xgettext_record_flag arguments.
* gettext-tools/tests/xgettext-c-format-6: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: In language Python, fix a format string handling bug.
Bruno Haible [Wed, 7 Jun 2023 15:51:18 +0000 (17:51 +0200)] 
xgettext: In language Python, fix a format string handling bug.

The option --flag=my_new_format:1:python-brace-format used to mark strings
inside my_new_format invocations as being 'python-format' instead of
'python-brace-format'.

* gettext-tools/src/xgettext.c (xgettext_record_flag): Use the correct index
into flag_table_python.
* gettext-tools/tests/xgettext-python-7: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: In language Vala, fix a format string handling bug.
Bruno Haible [Wed, 7 Jun 2023 15:22:03 +0000 (17:22 +0200)] 
xgettext: In language Vala, fix a format string handling bug.

* gettext-tools/src/xgettext.c (xgettext_record_flag): Store format_c related
flags also in flag_table_vala.
* gettext-tools/tests/xgettext-vala-5: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.

2 years agoxgettext: Reduce code duplication.
Bruno Haible [Wed, 7 Jun 2023 13:50:03 +0000 (15:50 +0200)] 
xgettext: Reduce code duplication.

* gettext-tools/src/xg-arglist-context.h (flag_context_list_table_add): Add
comment.
* gettext-tools/src/xg-arglist-context.c (set_flags_for_formatstring_type): New
function, extracted from flag_context_list_table_add.
(flag_context_list_table_add): Use it.

2 years agoxgettext: Support up to 4 format string parsers at the same time.
Bruno Haible [Mon, 5 Jun 2023 10:31:30 +0000 (12:31 +0200)] 
xgettext: Support up to 4 format string parsers at the same time.

* gettext-tools/src/xg-arglist-context.h (struct flag_context_ty): Add fields
is_format4, pass_format4.
* gettext-tools/src/xg-arglist-context.c (null_context, passthrough_context,
inherited_context, passthrough_context_circular_list,
flag_context_list_table_add): Update.
* gettext-tools/src/xg-message.c (set_format_flags_from_context,
decide_is_format, remember_a_message_plural): Update.
* gettext-tools/src/xgettext.h (current_formatstring_parser4): New declaration.
* gettext-tools/src/xgettext.c (struct extractor_ty): Add field
formatstring_parser4.
(current_formatstring_parser4): New variable.
(main, extract_from_file, language_to_extractor): Update.

2 years agoFix libintl exports.
Bruno Haible [Sun, 4 Jun 2023 18:48:28 +0000 (20:48 +0200)] 
Fix libintl exports.

On mingw, rpl_mbrtowc, rpl_mbsinit, hard_locale were exported.
On Cygwin, rpl_mbrtowc, rpl_vasnprintf were exported.

* gettext-runtime/intl/configure.ac: Map more rpl_* symbols to _libintl_*.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Mon, 5 Jun 2023 09:28:53 +0000 (11:28 +0200)] 
Update to the newest gnulib.

2 years agobuild: Don't rename error{_at_line} to rpl_error{_at_line} on native Windows.
Bruno Haible [Sun, 4 Jun 2023 15:34:25 +0000 (17:34 +0200)] 
build: Don't rename error{_at_line} to rpl_error{_at_line} on native Windows.

* gettext-tools/configure.ac (GNULIB_REPLACE_ERROR): Define only on Cygwin and
Android.
* gettext-tools/woe32dll/gettextlib-exports.c: Don't assume that
GNULIB_DEFINED_ERROR implies GNULIB_REPLACE_ERROR.

2 years agobuild: Make the Windows exports lists more maintainable.
Bruno Haible [Sun, 4 Jun 2023 15:33:32 +0000 (17:33 +0200)] 
build: Make the Windows exports lists more maintainable.

* gettext-tools/woe32dll/gettextlib-exports.c: Fix file title.
* gettext-tools/woe32dll/gettextsrc-exports.c: Likewise.
* gettext-tools/woe32dll/gettextpo-exports.c: Likewise.

2 years agobuild: Take advantage of gcc warning options not included in -Wall.
Bruno Haible [Fri, 2 Jun 2023 23:34:14 +0000 (01:34 +0200)] 
build: Take advantage of gcc warning options not included in -Wall.

* autogen.sh (GNULIB_MODULES_RUNTIME_OTHER, GNULIB_MODULES_LIBINTL,
GNULIB_MODULES_LIBASPRINTF, GNULIB_MODULES_TOOLS_OTHER): Add manywarnings.
* m4/more-warnings.m4: New file.

* libtextstyle/autogen.sh (GNULIB_MODULES): Add manywarnings.
Copy also more-warnings.m4.
* gnulib-local/modules/libxml (Makefile.am): New variable libxml_rpl_la_CFLAGS.
* libtextstyle/gnulib-local/modules/libcroco (Makefile.am): New variable
libcroco_rpl_la_CFLAGS.
* libtextstyle/gnulib-local/modules/libglib (Makefile.am): New variable
libglib_rpl_la_CFLAGS.
* libtextstyle/configure.ac: Invoke gt_MORE_WARNINGS, gl_CC_INHIBIT_WARNINGS.
* libtextstyle/lib/Makefile.am (AM_CFLAGS): Set to WARN_CFLAGS.
(config.h): Do the compilations with GL_CFLAG_INHIBIT_WARNINGS.

* gettext-runtime/configure.ac: Invoke gt_MORE_WARNINGS.
* gettext-runtime/src/Makefile.am (AM_CFLAGS): Set to WARN_CFLAGS.
* gnulib-local/modules/gettext-runtime-misc (Makefile.am): Add WARN_CFLAGS to
AM_CFLAGS.

* gettext-runtime/intl/configure.ac: Invoke gt_MORE_WARNINGS.
* gettext-runtime/intl/Makefile.am (AM_CFLAGS): Add WARN_CFLAGS.
* gnulib-local/modules/gettext-runtime-intl-misc (Makefile.am): Add WARN_CFLAGS
to AM_CFLAGS.

* gettext-runtime/libasprintf/configure.ac: Invoke gt_MORE_WARNINGS.
* gettext-runtime/libasprintf/Makefile.am (AM_CFLAGS): Set to WARN_CFLAGS.

* gettext-tools/configure.ac: Invoke gt_MORE_WARNINGS, gl_CC_INHIBIT_WARNINGS.
* gettext-tools/gnulib-lib/Makefile.am (AM_CFLAGS): Set to WARN_CFLAGS.
* gettext-tools/libgrep/Makefile.am (AM_CFLAGS): Set to WARN_CFLAGS.
* gettext-tools/src/Makefile.am (AM_CFLAGS): Set to WARN_CFLAGS.
* gettext-tools/libgettextpo/Makefile.am (AM_CFLAGS): Set to WARN_CFLAGS.
(config.h): Do the compilations with GL_CFLAG_INHIBIT_WARNINGS.

2 years agoUpdate after gnulib changed.
Bruno Haible [Sun, 4 Jun 2023 18:00:59 +0000 (20:00 +0200)] 
Update after gnulib changed.

* gettext-tools/src/po-error.c (_GL_NO_INLINE_ERROR): New macro.
* gettext-tools/libgettextpo/gettext-po.c (_GL_NO_INLINE_ERROR): Likewise.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Sun, 4 Jun 2023 17:59:02 +0000 (19:59 +0200)] 
Update to the newest gnulib.

2 years agoSilence "inlining failed" warnings.
Bruno Haible [Sat, 3 Jun 2023 12:53:54 +0000 (14:53 +0200)] 
Silence "inlining failed" warnings.

* gettext-tools/src/read-stringtable.c (comment_line_end): Remove 'inline'
marker.
* gettext-tools/src/x-scheme.c (is_other_number_syntax): Likewise.

2 years agoEnable better malloc/free checking in a few cases.
Bruno Haible [Sat, 3 Jun 2023 11:27:03 +0000 (13:27 +0200)] 
Enable better malloc/free checking in a few cases.

Pinpointed by gcc 13 warning:
warning: function might be candidate for attribute 'malloc' [-Wsuggest-attribute=malloc]

* gettext-tools/src/po-time.h: Include attribute.h.
(po_strftime): Mark with attribute 'malloc'.
* gettext-tools/src/write-po.h: Include attribute.h.
(make_range_description_string): Mark with attribute 'malloc'.

2 years agoSilence "potential null pointer dereference" warnings.
Bruno Haible [Sat, 3 Jun 2023 11:56:37 +0000 (13:56 +0200)] 
Silence "potential null pointer dereference" warnings.

Pinpointed by gcc 13 warning:
warning: potential null pointer dereference [-Wnull-dereference]

* gettext-tools/src/xg-arglist-context.c: Include verify.h.
(flag_context_list_table_add): Assert that the entry is non-NULL.

2 years agoSilence "use of possibly-NULL ‘class_name’" warnings.
Bruno Haible [Sat, 3 Jun 2023 12:12:02 +0000 (14:12 +0200)] 
Silence "use of possibly-NULL ‘class_name’" warnings.

* gettext-tools/src/write-java.c: Include verify.h.
(msgdomain_write_java): Assume that this xasprintf call returns non-NULL.

2 years agoSilence "use of possibly-NULL ‘string’ where non-null expected" warning.
Bruno Haible [Fri, 2 Jun 2023 23:33:22 +0000 (01:33 +0200)] 
Silence "use of possibly-NULL ‘string’ where non-null expected" warning.

* gettext-tools/src/write-po.c (make_range_description_string): Assume that this
xasprintf call returns non-NULL.

2 years agoSilence "use of possibly-NULL ‘msgstr’" warnings.
Bruno Haible [Fri, 2 Jun 2023 23:33:08 +0000 (01:33 +0200)] 
Silence "use of possibly-NULL ‘msgstr’" warnings.

* gettext-tools/src/write-po.c: Include verify.h.
(message_print_comment_filepos): Assume that this xasprintf call returns
non-NULL.
* gettext-tools/src/xg-message.c: Include verify.h.
(remember_a_message, remember_a_message_plural): Assume that this xasprintf call
returns non-NULL.
* gettext-tools/src/xgettext.c: Include verify.h.
(construct_header): Assume that this xasprintf call returns non-NULL.

2 years agoSilence "assignment discards ‘const’ qualifier from pointer target type" warnings.
Bruno Haible [Fri, 2 Jun 2023 23:32:23 +0000 (01:32 +0200)] 
Silence "assignment discards ‘const’ qualifier from pointer target type" warnings.

* gettext-tools/src/msginit.c (language_team_address): New local variable
'result'.
(plural_forms): Adjust type of local variable 'dirs'.
* gettext-tools/src/xg-message.c (remember_a_message): Reduce scope and adjust
type of local variable 'msgstr'.
(remember_a_message_plural): New local variable 'msgstr1_malloc'.
* gettext-tools/src/xgettext.c (main): New local variable
'defaulted_output_dir'.

2 years agoSilence "initialization discards ‘const’ qualifier from pointer target type" warnings.
Bruno Haible [Fri, 2 Jun 2023 23:31:33 +0000 (01:31 +0200)] 
Silence "initialization discards ‘const’ qualifier from pointer target type" warnings.

* gettext-tools/src/pos.h (struct lex_pos_ty): Change type of file_name field to
'const char *'.
* gettext-tools/src/read-catalog.c (default_destructor,
default_reset_comment_state): Cast file_name to 'char *' before free()ing it.
* gettext-tools/src/xg-arglist-parser.h (arglist_parser_remember,
arglist_parser_remember_msgctxt): Change type of file_name parameter.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_remember,
arglist_parser_remember_msgctxt): Likewise.

2 years agoSilence -Wformat warnings regarding 'int' vs. 'unsigned int' arguments.
Bruno Haible [Fri, 2 Jun 2023 23:30:59 +0000 (01:30 +0200)] 
Silence -Wformat warnings regarding 'int' vs. 'unsigned int' arguments.

* gettext-tools/src/read-catalog-abstract.c (catalog_reader_parse): Use %u
instead of %d in format string.
* gettext-tools/src/read-properties.c (UTF16_VALUE): Cast result to
'unsigned short'.
* gettext-tools/src/write-java.c (write_lookup_code,
write_java2_init_statements, write_java_code): Use %u instead of %d in format
strings.
* gettext-tools/src/x-perl.c (extract_balanced): Cast enum-typed fprintf
argument to 'int'.

2 years agoSilence "may write a terminating nul past the end of the destination" warnings.
Bruno Haible [Fri, 2 Jun 2023 23:30:00 +0000 (01:30 +0200)] 
Silence "may write a terminating nul past the end of the destination" warnings.

* gettext-tools/src/write-po.c (message_print_comment_filepos): Increase size of
buffer by 1.
* gettext-tools/src/xg-encoding.c (non_ascii_error_message,
non_utf8_error_message): Likewise.
* gettext-tools/src/xg-message.c (set_format_flags_from_context,
warn_format_string, remember_a_message): Likewise.

2 years agoSilence "this statement may fall through" warnings.
Bruno Haible [Fri, 2 Jun 2023 23:29:33 +0000 (01:29 +0200)] 
Silence "this statement may fall through" warnings.

* gettext-tools/src/x-lua.c: Include attribute.h.
(phase2_getc, phase3_get): Use FALLTHROUGH macro.

2 years agoSilence "missing initializer for field" warnings.
Bruno Haible [Fri, 2 Jun 2023 23:29:19 +0000 (01:29 +0200)] 
Silence "missing initializer for field" warnings.

* gettext-tools/src/xgettext.c (main, language_to_extractor): Initialize all
fields of extractor_ty.

2 years agoSilence "... shadows a previous local" warnings.
Bruno Haible [Fri, 2 Jun 2023 23:28:54 +0000 (01:28 +0200)] 
Silence "... shadows a previous local" warnings.

* gettext-tools/src/its.c (its_rule_apply): Reduce scope of local variable 'i'.
(_its_collect_text_content): Rename local variable 'buffer' to 'obuffer'.
(its_rule_list_extract_nodes): Reduce scope of local variable 'n'.
(_its_get_content): Reduce scope of local variable 'i'. Rename local variable
'i' to 'j'.
* gettext-tools/src/msgmerge.c (message_merge): Reduce scope of local variables
'i', 'len', 'cnt'.
(match_domain): Reduce scope of some local variables.
* gettext-tools/src/write-mo.c (write_table): Reduce scope of local variables
'j', 'm'.
* gettext-tools/src/xg-arglist-parser.c (arglist_parser_done): Rename local
variable 'i' to 'j'.
* gettext-tools/src/x-csharp.c (phase2_getc): Reduce scope of local variable
'c'.
* gettext-tools/src/x-javascript.c (phase2_getc): Likewise.
* gettext-tools/src/x-python.c (phase2_getc): Likewise.
* gettext-tools/src/x-lisp.c (read_object): Rename some uses of local variable
'c' to 'dmc'.
* gettext-tools/src/x-elisp.c (read_object): Rename some uses of local variable
'c' to 'ch' or 'dmc'.
* gettext-tools/src/x-librep.c (read_object): Likewise.
* gettext-tools/src/x-scheme.c (read_object): Likewise.
* gettext-tools/src/x-perl.c (extract_variable): Reduce scope of local variable
'c'.
* gettext-tools/src/x-vala.c (phase3_get): Reduce scope of local variable 'c2'.

2 years agoSilence "... shadows a parameter" warning.
Bruno Haible [Fri, 2 Jun 2023 23:28:42 +0000 (01:28 +0200)] 
Silence "... shadows a parameter" warning.

* gettext-tools/src/msgl-fsearch.c (message_fuzzy_index_alloc): Rename local
variable mlp.

2 years agoCode perfectionism.
Bruno Haible [Fri, 2 Jun 2023 23:28:17 +0000 (01:28 +0200)] 
Code perfectionism.

* gettext-tools/src/x-javascript.c (max): Remove unused macro.
(phase2_ungetc): Fix comment.

2 years agoCode perfectionism.
Bruno Haible [Fri, 2 Jun 2023 23:27:57 +0000 (01:27 +0200)] 
Code perfectionism.

* gettext-tools/src/write-po.c (putc): Remove unused macro.

2 years agoCode perfectionism.
Bruno Haible [Fri, 2 Jun 2023 23:27:46 +0000 (01:27 +0200)] 
Code perfectionism.

* gettext-tools/src/msgfmt.c (SIZEOF): Remove unused macro.
* gettext-tools/src/read-desktop.c (SIZEOF): Likewise.
* gettext-tools/src/x-desktop.c (SIZEOF): Likewise.

2 years agoCode perfectionism.
Bruno Haible [Fri, 2 Jun 2023 23:27:16 +0000 (01:27 +0200)] 
Code perfectionism.

* gettext-tools/src/format-lisp.c (VERIFY_LIST): Remove first, unused definition
of this macro.
* gettext-tools/src/format-scheme.c (VERIFY_LIST): Likewise.

2 years agoCode perfectionism.
Bruno Haible [Fri, 2 Jun 2023 23:26:49 +0000 (01:26 +0200)] 
Code perfectionism.

* gettext-tools/src/write-po.c (is_stylable): Define in both cases.

2 years agointl: Silence warnings "no previous prototype" and "nested extern declaration".
Bruno Haible [Fri, 2 Jun 2023 23:26:37 +0000 (01:26 +0200)] 
intl: Silence warnings "no previous prototype" and "nested extern declaration".

* gettext-runtime/intl/gettextP.h (_nl_log_untranslated): New declaration.
* gettext-runtime/intl/dcigettext.c: Remove nested declaration of _nl_log_untranslated.
* gettext-runtime/intl/log.c: Include gettextP.h.

2 years agointl: Silence a "no previous prototype" warning.
Bruno Haible [Fri, 2 Jun 2023 23:26:11 +0000 (01:26 +0200)] 
intl: Silence a "no previous prototype" warning.

* gettext-runtime/intl/langprefs.c: Include gettextP.h.

2 years agointl: Improve declaration of 'struct binding'.
Bruno Haible [Fri, 2 Jun 2023 23:25:53 +0000 (01:25 +0200)] 
intl: Improve declaration of 'struct binding'.

* autogen.sh (GNULIB_MODULES_LIBINTL): Add flexmember.
* gettext-runtime/intl/gettextP.h (struct binding): Use FLEXIBLE_ARRAY_MEMBER
instead of ZERO.
* gettext-runtime/intl/bindtextdom.c: Include flexmember.h.
(offsetof): Remove fallback definition.
(set_binding_values): Use FLEXNSIZEOF.

2 years agolibtextstyle: Silence a "missing initializer for field" warning.
Bruno Haible [Fri, 2 Jun 2023 23:25:21 +0000 (01:25 +0200)] 
libtextstyle: Silence a "missing initializer for field" warning.

* libtextstyle/lib/color.c (print_color_test): Fill the r, g, b values of all
colors[] elements.

2 years agolibtextstyle: Silence a "no previous prototype" warning.
Bruno Haible [Fri, 2 Jun 2023 23:25:06 +0000 (01:25 +0200)] 
libtextstyle: Silence a "no previous prototype" warning.

* libtextstyle/gnulib-local/lib/memory-ostream.oo.c (memory_ostream::contents):
Mark as static.

2 years agoFix support for Qt4 plural forms format strings.
Bruno Haible [Fri, 2 Jun 2023 23:24:34 +0000 (01:24 +0200)] 
Fix support for Qt4 plural forms format strings.

Pinpointed by gcc 13 warning:
warning: missing initializer for field ‘is_format3’ of ‘flag_context_ty’ [-Wmissing-field-initializers]

* gettext-tools/src/xg-arglist-context.c (null_context, passthrough_context,
passthrough_context_circular_list): Initialize also the fields is_format3,
pass_format3.

2 years agoxgettext: Fix a portability problem: Don't assume anything about the value of EOF.
Bruno Haible [Fri, 2 Jun 2023 23:23:14 +0000 (01:23 +0200)] 
xgettext: Fix a portability problem: Don't assume anything about the value of EOF.

Pinpointed by gcc 13 warning:
warning: macro "P7_EOF" is not used [-Wunused-macros]

* gettext-tools/src/x-c.c (P7_STRING_END): Remove macro.
(phase7_getc): Transform EOF to P7_EOF.
(phase5_get): Test for P7_EOF, not EOF.
* gettext-tools/src/x-vala.c (P7_STRING_END): Remove macro.
(phase7_getc): Transform EOF to P7_EOF.
(phase3_get): Test for P7_EOF, not EOF.

2 years agolibgrep: Don't crash upon out-of-memory.
Bruno Haible [Fri, 2 Jun 2023 23:22:53 +0000 (01:22 +0200)] 
libgrep: Don't crash upon out-of-memory.

Pinpointed by gcc 13 warning:
warning: use of possibly-NULL ‘mb_properties’ where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument]

* gettext-tools/libgrep/m-fgrep.c (check_multibyte_string): Check the malloc()
return value.

2 years agolibtextstyle: Don't crash if xgethostname() returns NULL.
Bruno Haible [Fri, 2 Jun 2023 23:22:24 +0000 (01:22 +0200)] 
libtextstyle: Don't crash if xgethostname() returns NULL.

Pinpointed by gcc 13 warning:
warning: dereference of possibly-NULL ‘p’ [CWE-690] [-Wanalyzer-possible-null-dereference]

* libtextstyle/gnulib-local/lib/term-ostream.oo.c (term_ostream_create): If
xgethostname() returns NULL, use a dummy hash code.

2 years agolibxml: Fix possible null pointer access (regression 2023-05-26).
Bruno Haible [Fri, 2 Jun 2023 23:21:57 +0000 (01:21 +0200)] 
libxml: Fix possible null pointer access (regression 2023-05-26).

Pinpointed by gcc 13 warning:
warning: dereference of NULL ‘clone’ [CWE-476] [-Wanalyzer-null-dereference]

* gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Assign clone from
cloneAttr.

2 years agolibxml: Fix compilation error with gcc < 10 (regression 2023-05-26).
Bruno Haible [Mon, 29 May 2023 09:41:07 +0000 (11:41 +0200)] 
libxml: Fix compilation error with gcc < 10 (regression 2023-05-26).

* gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Add braces.

2 years agoformat-c: Recognize size specifiers w8, w16, w32, w64, wf8, wf16, wf32, wf64.
Bruno Haible [Sun, 28 May 2023 15:45:08 +0000 (17:45 +0200)] 
format-c: Recognize size specifiers w8, w16, w32, w64, wf8, wf16, wf32, wf64.

* gettext-tools/src/format-c.c (INVALID_SIZE_SPECIFIER): New macro.
* gettext-tools/src/format-c-parse.h (format_parse_entrails): Accept only one
size specifier, not a sequence of size specifiers. Accept "wN" and "wfN",
where N = 8, 16, 32, 64. Reject integer size specifiers for floating-point
directives. Reject integer size specifiers other than "l" for %c and %s.
* gettext-tools/tests/format-c-1: Add more test cases.
* gettext-tools/tests/format-c-2: Likewise.
* NEWS: Mention it.

2 years agoc-format: Recognize the %b format directive.
Bruno Haible [Sun, 28 May 2023 10:56:43 +0000 (12:56 +0200)] 
c-format: Recognize the %b format directive.

* gettext-tools/src/format-c-parse.h (format_parse_entrails): Recognize %b as
a directive that takes an unsigned integer argument.
* gettext-tools/tests/format-c-1: Add test of %b.
* gettext-tools/tests/format-c-2: Add type compatibility test for %b.
* NEWS: Mention it.

2 years agoxgettext: Support digit separators as in ISO C 23.
Bruno Haible [Sun, 28 May 2023 10:14:07 +0000 (12:14 +0200)] 
xgettext: Support digit separators as in ISO C 23.

* gettext-tools/src/x-c.c (phase5_get): Recognize digit separators.
* gettext-tools/tests/xgettext-c-2: Add more test cases of integer and
floating-point literals.
* NEWS: Mention it.

2 years agointl: Support bison ≥ 3.7 better.
Bruno Haible [Fri, 26 May 2023 23:46:59 +0000 (01:46 +0200)] 
intl: Support bison ≥ 3.7 better.

* gettext-runtime/intl/Makefile.am (generate-plural): Renamed from
$(srcdir)/plural.c.
(plural.c, plural.h): New parallel-safe rules.
(BUILT_SOURCES): Add plural.c, plural.h.

2 years agobuild: Make bison rules more reliable.
Bruno Haible [Fri, 26 May 2023 23:46:03 +0000 (01:46 +0200)] 
build: Make bison rules more reliable.

* gettext-runtime/intl/Makefile.am ($(srcdir)/plural.c): Fix sed expressions.
* gettext-tools/src/Makefile.am (po-gram-gen.c, cldr-plural.c): Likewise.

2 years agoSilence a gcc warning "array subscript ... is partly outside array bounds".
Bruno Haible [Fri, 26 May 2023 22:25:12 +0000 (00:25 +0200)] 
Silence a gcc warning "array subscript ... is partly outside array bounds".

* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add flexmember.
* gettext-tools/src/xg-arglist-parser.h (struct arglist_parser): Use
FLEXIBLE_ARRAY_MEMBER.
* gettext-tools/src/xg-arglist-parser.c: Include flexmember.h.
(arglist_parser_alloc, arglist_parser_clone): Use FLEXNSIZEOF instead of
hand-made size computations.

2 years agoUpdate to the newest gnulib.
Bruno Haible [Sun, 9 Apr 2023 09:52:18 +0000 (11:52 +0200)] 
Update to the newest gnulib.

2 years agolibgrep: Optimize and silence gcc warning.
Bruno Haible [Fri, 26 May 2023 21:02:24 +0000 (23:02 +0200)] 
libgrep: Optimize and silence gcc warning.

* gettext-tools/libgrep/m-fgrep.c (Fexecute): Set mb_properties to NULL in a
unibyte locale.

2 years agolibgrep: Modernize.
Bruno Haible [Fri, 26 May 2023 20:59:26 +0000 (22:59 +0200)] 
libgrep: Modernize.

* gettext-tools/libgrep/m-fgrep.c: Include <wchar.h> unconditionally. Assume
mbrlen function, by virtue of the gnulib module 'mbrlen'. Don't include
<wctype.h>. Assume ANSI C.

2 years agoSilence a gcc warning.
Bruno Haible [Fri, 26 May 2023 16:59:49 +0000 (18:59 +0200)] 
Silence a gcc warning.

* gettext-tools/src/write-po.c (memset_small): Use
'#pragma GCC diagnostic ignored' to silence a bogus gcc warning.

2 years agoSilence a gcc warning.
Bruno Haible [Fri, 26 May 2023 15:21:25 +0000 (17:21 +0200)] 
Silence a gcc warning.

* gettext-tools/src/format-scheme.c (II): Mark as possibly unused.

2 years agolibxml: Silence several gcc warnings.
Bruno Haible [Fri, 26 May 2023 15:07:04 +0000 (17:07 +0200)] 
libxml: Silence several gcc warnings.

* gnulib-local/lib/libxml/SAX2.c (xmlNsErrMsg): Mark as possibly unused.
(xmlSAX2AttributeDecl, xmlSAX2ElementDecl, xmlSAX2NotationDecl): Mark a local
variable as possibly unused.
* gnulib-local/lib/libxml/encoding.c (xmlCharEncCloseFunc): Likewise.
* gnulib-local/lib/libxml/trionan.c (compute_minus_zerod, minus_zerod): Mark as
possibly unused.
* gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Use a differently typed
variable cloneAttr.

2 years agointl: Silence a gcc warning.
Bruno Haible [Fri, 26 May 2023 14:11:55 +0000 (16:11 +0200)] 
intl: Silence a gcc warning.

* gettext-runtime/intl/localealias.c (read_alias_file): Silence a bogus
-Wuse-after-free warning.

2 years agobuild: Improve autoconf quoting.
Bruno Haible [Fri, 26 May 2023 14:03:57 +0000 (16:03 +0200)] 
build: Improve autoconf quoting.

* gettext-runtime/intl/configure.ac: Fix quoting of AS_HELP_STRING argument.
* gettext-tools/configure.ac: Likewise.