Mark Dickinson <dicki...@gmail.com> added the comment:

> Technically arbitrary relational comparisons of pointers are undefined,
> but in practice Antoine's assumptions here are very modest.

I disagree:  there's a very real practical danger here.  Namely, optimizing 
compilers are free to assume that code doesn't involve any undefined behaviour 
and optimize accordingly.  gcc for one is known to make extensive use of this 
freedom.  I wouldn't be at all surprised to find some current or future version 
of gcc optimizing an (p >= start_of_array) check to 'always true', on the basis 
that it *will* always be true in legal code.

Please don't introduce undefined behaviour here---it's asking for trouble.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10044>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to