> On Thursday, November 19, 2009 1:41 PM, Sean Hunt wrote > > On Thu, Nov 19, 2009 at 11:30 AM, Ken Dyck > <[email protected]> wrote: > > On Thursday, November 19, 2009 11:26 AM, Chris Lattner wrote: > >> > >> Are the ptrdiff types ever actually different from the > intptr types? > > > > Not on any of the architectures that llvm currently targets. Or any > > architecture that I know of, for that matter. On the other > hand, the C > > standard, as far as I understand it, allows the two types to vary > > independently. > > I could conceive of an architecture where ptrdiff_t is a size > bigger than intptr_t in order to be able to accurately > represent any pointer subtraction. On the other hand, I can't > really conceive of a situation of where you'd use more than > half your memory on the same array and still be willing to > spare a byte to hold a subtraction.
I suppose another possibility would be some kind of application-specific co-processor that shares a small region of memory with a host processor. If the co-processor keeps the host's pointer representation to ease passing pointers between the two, it might need a larger intptr_t than its ptrdiff_t. -Ken _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
