[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Problem with lstrlib.c
- From: Paul Hudson <phudson@...>
- Date: Mon, 22 Feb 2010 12:26:17 +0000
> 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)