Message118133
> I can't say anything about the standard, but p > q looks like it should
> be the same as (p - q) > 0
Yep.
> which looks rather well-defined for pointers.
Nope. It's only well-defined for pointers pointing into the same array (or to one past the end of an array). Otherwise it's undefined behaviour.
See section 6.5.6, paragraph 9, of
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf |
|
Date |
User |
Action |
Args |
2010-10-07 21:04:03 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, amaury.forgeotdarc, pitrou, eric.smith, stutzbach |
2010-10-07 21:04:02 | mark.dickinson | set | messageid: <1286485442.93.0.345929097918.issue10044@psf.upfronthosting.co.za> |
2010-10-07 21:04:01 | mark.dickinson | link | issue10044 messages |
2010-10-07 21:04:01 | mark.dickinson | create | |
|