diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-01-06 10:28:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-01-06 12:56:58 +0100 |
commit | 101fa3fc1e03f82c864069338956a26dd85de219 (patch) | |
tree | 798daa1f93bd043891488c8d55996e890a78d440 /external | |
parent | da50627b76137a975e580c53228b0c0f86836b0b (diff) |
external/clucene: Fix MSVC /Zc:strictStrings
...which is apparently enabled at least in MSVC 2019 16.8.3 when building with
--with-latest-c++ (i.e., /std:c++latest):
> C:/lo/core/workdir/UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/PorterStemmer.cpp(124): error C2664: 'bool lucene::analysis::PorterStemmer::ends(TCHAR *)': cannot convert argument 1 from 'const wchar_t [5]' to 'TCHAR *'
> C:/lo/core/workdir/UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/PorterStemmer.cpp(124): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
> C:/lo/core/workdir/UnpackedTarball/clucene/src/contribs-lib/CLucene/analysis/PorterStemmer.cpp(97): note: see declaration of 'lucene::analysis::PorterStemmer::ends'
etc. (and which is not silenced by gb_Library_set_warnings_disabled in
external/clucene/Library_clucene.mk, unlike the corresponding Clang/GCC
-Wwrite-strings)
Change-Id: Id3c8eefa4658bf942de6c8ae9b219212eba79995
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108840
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'external')
-rw-r--r-- | external/clucene/UnpackedTarball_clucene.mk | 1 | ||||
-rw-r--r-- | external/clucene/patches/write-strings.patch | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/external/clucene/UnpackedTarball_clucene.mk b/external/clucene/UnpackedTarball_clucene.mk index 0aded2ceedd6..37c1c16dab0f 100644 --- a/external/clucene/UnpackedTarball_clucene.mk +++ b/external/clucene/UnpackedTarball_clucene.mk @@ -49,6 +49,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,clucene,\ external/clucene/patches/ostream-wchar_t.patch \ external/clucene/patches/heap-buffer-overflow.patch \ external/clucene/patches/c++20.patch \ + external/clucene/patches/write-strings.patch \ )) ifneq ($(OS),WNT) diff --git a/external/clucene/patches/write-strings.patch b/external/clucene/patches/write-strings.patch new file mode 100644 index 000000000000..d1661ee727d1 --- /dev/null +++ b/external/clucene/patches/write-strings.patch @@ -0,0 +1,22 @@ +--- src/contribs-lib/CLucene/analysis/PorterStemmer.cpp ++++ src/contribs-lib/CLucene/analysis/PorterStemmer.cpp +@@ -94,7 +94,7 @@ + return true; + } + +- bool PorterStemmer::ends(TCHAR *s) { ++ bool PorterStemmer::ends(const TCHAR *s) { + size_t l = _tcslen(s); + size_t o = k-l+1; + if (o < k0) +--- src/contribs-lib/CLucene/analysis/PorterStemmer.h ++++ src/contribs-lib/CLucene/analysis/PorterStemmer.h +@@ -68,7 +68,7 @@ + */ + bool cvc(size_t i); + +- bool ends(TCHAR *s); ++ bool ends(const TCHAR *s); + + /* setto(s) sets (j+1),...k to the characters in the string s, readjusting + k. */ |