lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> On our system, ptrdiff_t is unsigned long.


Your system isn't ANSI C. I would expect this breaks quite a number of programs.

"When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object; the result is the difference of the subscripts of the two array elements. The size of the result is implementation-defined, and its type (a signed integer type) is ptrdiff_t defined in the <stddef.h> header."

(Not got the standard in front of me, but it's quoted from here: http://stackoverflow.com/questions/1645669/char-a-b-what-type-is-b-a-and-how-do-i-printf-it)