On Thursday 04 October 2001 11:08 am, Bryan C. Warnock wrote: > In C9x, pointer-integer conversions (except for 0) aren't guaranteed for > doing pointer arithmetic. (There was a good explanation that I ran across > the other day, but I can't seem to find it now.)
Found it. The ANSI rationale (1994) 3.2.2.3 - Pointers The use of void * (``pointer to void'') as a generic object pointer type is an invention of the Committee. Adoption of this type was stimulated by the desire to specify function prototype arguments that either quietly convert arbitrary pointers (as in fread) or complain if the argument type does not exactly match (as in strcmp). Nothing is said about pointers to functions, which may be incommensurate with object pointers and/or integers. Since pointers and integers are now considered incommensurate, the only integer that can be safely converted to a pointer is the constant 0. The result of converting any other integer to a pointer is machine dependent. -- Bryan C. Warnock [EMAIL PROTECTED]
