]> git.ipfire.org Git - thirdparty/gettext.git/commit
gettext.h: Avoid "warning: ISO C++ forbids variable length array" with -pedantic.
authorBruno Haible <bruno@clisp.org>
Tue, 15 Oct 2024 14:49:13 +0000 (16:49 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 15 Oct 2024 14:49:13 +0000 (16:49 +0200)
commitd2293e7a807388447b868f4a4333370bd77c8d3e
treef959b18e95635a806052e62c2a0e6c7374b95ae8
parenteeab24002b569910c5d244435bd774f3cdeaed0b
gettext.h: Avoid "warning: ISO C++ forbids variable length array" with -pedantic.

Both "g++ -pedantic" and "clang++ -pedantic" warn about use of VLAs.
Since we cannot distinguish "g++" from "g++ -pedantic" through a preprocessor
macro, it's best to not use a VLA in C++.

Reported by Jens Seidel <jensseidel@users.sf.net>
via <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547798>
at <https://savannah.gnu.org/bugs/index.php?55149>.

* gnulib-local/lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Define
to 0 in C++ mode.
gnulib-local/lib/gettext.h