build: no -Wrestrict warning under gcc 12 (from dev e727ce1d248d)

extended_latin_symbol_pattern() assigned a string literal to a std::string
inside its loop, for which gcc 12 reports a bogus memcpy overlap at -O3.  The
separator is a const char* now.  No behaviour change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
ackandClaude Fable 5.1 committed 2026-09-21 23:28:17 +02:00
1 parent 217c0f3fc5
commit 93d649e23c
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -133,7 +133,10 @@ const std::regex unresolved_nonascii_re(R"(\^[A-Za-z0-9]{1,6}\^)");
std::string extended_latin_symbol_pattern()
{
std::string result {};
std::string sep = "";
// A pointer, not a std::string: gcc 12 (the container's compiler) warns
// -Wrestrict on assigning a string literal to a std::string here -- a
// false positive of that release -- and the separator needs no storage.
const char* sep = "";
for (const auto& nr : extended_latin_symbols) {
result += sep;
result += nr;