https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109565
--- Comment #5 from Frank Heckenbach <f.heckenb...@fh-soft.de> --- > Agreed, but you asked for it with that option. Nope, I asked for warnings about signed integer overflow. > So you shouldn't have to care about begin(c) < end(c) either, it has to be > true. But you asked the compiler to give a warning if it relies on that > assumption. This was a simplified example. My real code was more like "auto i = begin (c); ((i >= end (c) || f (*i++)), ...);". > > Note that https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html doesn't > > even mention pointers (let alone objects such as span) for > > -Wstrict-overflow. > > You're comparing std::span iterators, and those iterators are pointers. Yes, pointers, and this warning isn't (documented to be) about pointers, but about signed overflow. I don't know if GCC considers pointers signed internally; I don't; and even GCC's output of pointers treats them as unsigned; if anything, that's an implementation detail. If you're not going to change it, please at least mention pointers in the manual so the user has a small chance to understand what's going on.