[Bug middle-end/97048] [meta-bug] bogus/missing -Wstringop-overread warnings

2023-05-16 Thread tonyguil at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97048

Tony Guilfoyle  changed:

   What|Removed |Added

 CC||tonyguil at gmail dot com

--- Comment #1 from Tony Guilfoyle  ---
Source file foo.cpp:

#include 
struct T
  {
  void* p ;
  std::vector a[10] ;
  } ;
void f (T& t, const std::vector& u, int i)
  {
  std::vector& v = t.a[i] ;
  std::vector 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=]

[Bug middle-end/97048] [meta-bug] bogus/missing -Wstringop-overread warnings

2023-05-17 Thread tonyguil at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97048

--- Comment #3 from Tony Guilfoyle  ---
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  ---
> 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.
>