https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80346
--- Comment #12 from Paolo Bonzini <bonzini at gnu dot org> --- > So AFAICT, the warning for the first testcase is valid as well. True, but isn't the maximum object size (2^63-1 aka PTRDIFF_MAX) as bogus as 2^64-1? We are using -1 which is a bit ugly but SIZE_MAX would also warn and the warning then makes less sense. In other words, I'm not sure it's particularly useful to have a warning if GCC cannot determine the object size at all.