https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97976
--- Comment #10 from Peter Bisroev <peter at int19h dot net> --- Jonathan, thank you so much for your explanation. As soon as I read it, it all started to make sense. >You cannot increment or decrement a pointer past the end of an array (except >the one past the end position). Yes of course, that is perfectly reasonable. And unless I am mistaken, the examples that I have provided do not do that directly because as the "array" in those examples starts at address 0 as can be possible in some embedded systems. But with the knowledge about how by default gcc treats a pointer to address 0 everything can be perfectly explained. >GCC assumes there is no object at address zero, see the documentation for >-fdelete-null-pointer-checks Thank you for pointing this flag out to me. After reading its description and searching a bit I can see that I am not the only one that got caught off guard with this as shown in these links: * https://gcc.gnu.org/legacy-ml/gcc-patches/2015-04/msg00790.html * https://gcc.gnu.org/legacy-ml/gcc-patches/2007-03/msg01968.html * https://lkml.org/lkml/2018/4/4/601 * https://reviews.llvm.org/D47894 I will definitely go through gcc man page again to see if there is anything else that we should pay attention to. Once again, thank you for taking the time to explain all of this!