Do nil pointers convert to nil pointers?

Henry Spencer henry at zoo.toronto.edu
Thu Mar 21 03:47:10 AEST 1991


In article <1991Mar19.234219.22867 at cbnewsj.att.com> asd at cbnewsj.att.com (Adam S. Denton) writes:
>When generic_func is called, the nil (T *) argument x will be converted
>to (void *) before generic_func gets it.  My question is, is this
>guaranteed to produce a *nil* generic pointer, or not?  In other words,
>does ANSI guarantee that (void *)0 compares equal to (void *)(T *)0...

(Point of terminology:  there is no such thing as "nil" in C.  You are
talking about null pointers.)

ANSI C guarantees that a null pointer of one type, converted to another
type, is a null pointer of the new type.
-- 
"[Some people] positively *wish* to     | Henry Spencer @ U of Toronto Zoology
believe ill of the modern world."-R.Peto|  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.lang.c mailing list