Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mit-hector.UUCP Path: utzoo!linus!decvax!genrad!mit-eddie!mit-hector!newman From: newman@mit-hector.UUCP (Ron Newman) Newsgroups: net.lang.c Subject: if (p), where p is a pointer Message-ID: <118@mit-hector.UUCP> Date: Tue, 10-Sep-85 23:31:46 EDT Article-I.D.: mit-hect.118 Posted: Tue Sep 10 23:31:46 1985 Date-Received: Thu, 12-Sep-85 22:21:44 EDT Organization: MIT Project Athena Lines: 22 With all this talk about NULL pointers not necessarily being equal to 0, I'm no longer sure what is and isn't portable code. An C idiom I see (and write) frequently is *ptr; ... if (ptr) Will this work correctly on a machine where NULL is not 0? Does it really need to say if (ptr != NULL) ?? (Disclaimer: I've only known C and Unix for nine months, and have used only Berkeley 4.2 and only on a VAX. Thus the discussion about NULL and 0 being non-equivalent came as a great shock.) /Ron Newman, MIT Project Athena