const volatile behaviour change in GCC 7
Paul.Koning@dell.com
Paul.Koning@dell.com
Thu Sep 22 14:57:00 GMT 2016
> On Sep 22, 2016, at 6:17 AM, David Brown <david@westcontrol.com> wrote:
>
> ...
> Your trouble is that your two pointers, cur and end, are pointing at
> different variables. Comparing two pointers that are independent (i.e.,
> not pointing to parts of the same aggregate object) is undefined - the
> compiler can assume that these two external objects could be anywhere in
> memory, so there is no way (in pure C) for you to know or care how they
> are related. Therefore it can assume that you will never reach "cur ==
> end".
Would making them intptr_t instead of pointers fix that?
paul
More information about the Gcc
mailing list