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:
1 parent
217c0f3fc5
commit
93d649e23c
2 files changed
+5
-2
No files matched your search
@@ -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
|
Report problems (or send patches) to the author; accepted changes are
|
||||||
applied to the development tree and appear in a following snapshot.
|
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
|
## License
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -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 extended_latin_symbol_pattern()
|
||||||
{
|
{
|
||||||
std::string result {};
|
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) {
|
for (const auto& nr : extended_latin_symbols) {
|
||||||
result += sep;
|
result += sep;
|
||||||
result += nr;
|
result += nr;
|
||||||
|
|||||||
Reference in new issue
Block a user