Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!caen!sol.ctr.columbia.edu!ira.uka.de!smurf!altger!doitcr!de.intel.com!intelhf!ichips!inews!hopi!bhoughto From: bhoughto@hopi.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: Do nil pointers convert to nil pointers? Message-ID: <3132@inews.intel.com> Date: 20 Mar 91 01:47:54 GMT References: <1991Mar19.234219.22867@cbnewsj.att.com> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 16 People have been asking ANSI-questions like they're writing a test suite for the standard... In article <1991Mar19.234219.22867@cbnewsj.att.com> asd@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."