This is from an intermediate bad reduction in another PR: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115137#c5 ``` enum { a } b; int d, e; static void f(char *g, char *h) { for (; g < h; g++) /* Comparison of two distinct & disjoint pointers */ if (b) ++d; } int main() { f("somepage.html", "" + e); } ``` We don't warn on comparing these distinct pointers. I suppose it might be hard to do this in general without some aliasing sanitizer, but for constant pool references, it should be okay?
Confirmed. This warning can't be done in the front-end. It might become as useless as strict aliasing and strict overflows were ...