Do nil pointers convert to nil pointers?
Blair P. Houghton
bhoughto at hopi.intel.com
Wed Mar 20 11:47:54 AEST 1991
People have been asking ANSI-questions like they're writing
a test suite for the standard...
In article <1991Mar19.234219.22867 at cbnewsj.att.com> asd at cbnewsj.att.com (Adam S. Denton) writes:
[...for some defined types T, T1, and T2...]
>does ANSI guarantee that (void *)0 compares equal to (void *)(T *)0,
>or is this just wishful thinking on my part?
>On a related note, can anything be said for (T1 *)0 vs. (T1 *)(T2 *)0?
>(Not that converting arbitrary pointers is an acceptable practice... :-))
"Two null pointers, converted through possibly different sequences
of casts to pointer types, shall compare equal."
(ANSI X3.159-1989, sec. 3.2.2.3, p. 38, ll. 5-6)
--Blair
"Works for me."
More information about the Comp.lang.c
mailing list