From: Tom L. <tg...@ss...> - 2006-04-29 05:30:50
|
John Bowler <jb...@ac...> writes: > ... there is no guarantee in ANSI-C that the process of converting a > pointer to an integer and back again to a pointer will do anything > useful. (The rationale makes this clear.) AFAICT, the actual facts on the ground are that "long" is always the same width as pointers. One could imagine someone trying to publish a C compiler that broke that equivalence, but it would break enough extant code that they'd likely soon reconsider. The spec seems to be trying to cater for systems that want to define pointers as 32 bits while int and long and ptrdiff_t are only 16 bits (ie, you're not allowed to make an array bigger than 64k). But if there ever were any such systems, they went out of favor decades ago [1]; anyone who tried to reintroduce one today would be laughed off the face of the earth. There is *no* need for libpng to support such silliness. Name one system you know of that has arithmetic registers narrower than pointer registers. regards, tom lane [1] it sounds a whole lot like C.mmp actually, but that hardware is thirty years dead. Man, I'm getting old. |