https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103343
--- Comment #5 from Andrew Pinski ---
> The only thing that is questionable is the comparison with pointer past the
> end of an object, which is merely unspecified.
Ok, it is a dup of bug 93051.
*** This bug has been marked as a duplicate of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103343
--- Comment #4 from Lénárd Szolnoki ---
A complete program example:
f.h:
```
#pragma once
extern int x[1];
extern int y;
int f(int* p, int* q);
```
f.cpp:
```
#include "f.h"
int f(int* p, int* q) {
*q = y;
if (p == (x + 1)) {
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103343
--- Comment #3 from Gabriel Ravier ---
Well the code does not invoke undefined behavior here, it just so happens that
`p == (x + 1)` because `y` happens to be laid out in memory after `x` (note:
this isn't a guarantee, of course, but GCC can't p
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103343
Martin Sebor changed:
What|Removed |Added
CC||msebor at gcc dot gnu.org
--- Comment #2
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103343
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---