https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119037
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2025-02-27 --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Halalaluyafail3 from comment #0) > Issue two is caused by the subtraction of one not considering that max_size > of the allocator can return zero, which causes wraparound to the maximum > value. Such an allocator is so silly I'm not sure it's worth considering. > Theoretically, unintended wraparound could also happen in __diffmax if > PTRDIFF_MAX/sizeof(_CharT) is greater than SIZE_MAX and sizeof(_CharT) is > not a positive integer power of two. However, I'm not sure any targets exist > where this combination can arise so it's probably not worth considering I don't think there are any such targets. There is a bug here, but it seems incredibly low priority to fix.