This is a meta-bug to track false positives and negatives in the -Wstringop-overread warning, new in GCC 11 (formerly included in -Wstringop-overflow).
Source file foo.cpp: #include <vector> struct T { void* p ; std::vector<char> a[10] ; } ; void f (T& t, const std::vector<char>& u, int i) { std::vector<char>& v = t.a[i] ; std::vector<char> w (u.begin(), u.end()) ; v.resize (v.size() - w.size()) ; // <-- Warning generated here } Command line: g++ -std=c++20 -Wall -O3 -c -o foo.obj foo.cpp g++ --version: g++.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 12.2.0 Problem: Spurious warning emitted: specified bound between 9223372036854775808 and 18446744073709551614 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
Tony, this is just a meta-bug that has links to the real bugs. Please either add that as a comment to an existing bug (if it's the same as one of them) or file a new bug (and set "Blocks: 97048" so that it links back here). But since your one seems to be about -Wstringop-overflow not -Wstringop-overread I don't think it is actually related to this meta-bug at all. Maybe it's related to PR 97185 instead.
I jumped through enough hoops already, I think. You can take it from here if you want. All the best, Tony On 16/05/2023 18:28, redi at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97048 > > --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- > Tony, this is just a meta-bug that has links to the real bugs. Please either > add that as a comment to an existing bug (if it's the same as one of them) or > file a new bug (and set "Blocks: 97048" so that it links back here). But since > your one seems to be about -Wstringop-overflow not -Wstringop-overread I don't > think it is actually related to this meta-bug at all. Maybe it's related to PR > 97185 instead. >