From 93d649e23ced303de49b3376d7bb415edf31f57f Mon Sep 17 00:00:00 2001 From: Andy Kopra Date: Mon, 21 Sep 2026 23:28:17 +0200 Subject: [PATCH] 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 --- README.md | 2 +- mac/character.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8eb1e03..0ae6e3d 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ are regenerated on each release — patches cannot be merged directly. Report problems (or send patches) to the author; accepted changes are applied to the development tree and appear in a following snapshot. -This snapshot was assembled from development commit `2e453744f5e9`. +This snapshot was assembled from development commit `e727ce1d248d`. ## License diff --git a/mac/character.cpp b/mac/character.cpp index 84c27a0..4876d6a 100644 --- a/mac/character.cpp +++ b/mac/character.cpp @@ -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;