Message118132
> 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. |
|
Date |
User |
Action |
Args |
2010-10-07 21:00:38 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, amaury.forgeotdarc, pitrou, eric.smith, stutzbach |
2010-10-07 21:00:38 | mark.dickinson | set | messageid: <1286485238.28.0.948908067086.issue10044@psf.upfronthosting.co.za> |
2010-10-07 21:00:36 | mark.dickinson | link | issue10044 messages |
2010-10-07 21:00:35 | mark.dickinson | create | |
|