Does (size_t)((char *)0) ever not evaluate to 0?

Posted by Bruce Christensen on Stack Overflow See other posts from Stack Overflow or by Bruce Christensen
Published on 2010-04-05T22:20:44Z Indexed on 2010/04/05 22:23 UTC
Read the original article Hit count: 166

According to the responses in "Why subtract null pointer in offsetof()?" (and my reading of K&R), the C standard doesn't require that (size_t)((char *)0) == 0. Still, I've never seen a situation where casting a null pointer to an integer type evaluates to anything else.

If there is a compiler or scenario where (size_t)((char *)0) != 0, what is it?

© Stack Overflow or respective owner

Related posts about c

    Related posts about pointers