Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!munnari!natmlab!theo From: theo@natmlab.dms.oz (Theo ten Brummelaar) Newsgroups: comp.unix.xenix Subject: Re: Microport Users' Group Bug List (LONG) Message-ID: <1854@natmlab.dms.oz> Date: Mon, 27-Jul-87 20:13:56 EDT Article-I.D.: natmlab.1854 Posted: Mon Jul 27 20:13:56 1987 Date-Received: Wed, 29-Jul-87 05:37:35 EDT References: <166@qetzal.UUCP> <157@hobbes.UUCP> <245@ddsw1.UUCP> Organization: CSIRO Maths and Stats & Applied Physics, Sydney, Australia Lines: 34 Summary: (char *) NULL is *not* a pointer to the value null. In article <245@ddsw1.UUCP>, karl@ddsw1.UUCP (Karl Denninger) writes: > Hmmm... Some things to consider: > a) NULL is declared in large model programs to be '0L' (look in the > header file) > b) (char *) variable, where variable contains 0, works in this > situation. (char *) NULL does not. > c) I am *not* passing NULL, but rather a POINTER to it. The value > pointed TO at that location should BE the null! > Will be more than happy to eat my bug report if there's a good reason why ... In my understanding (char *) NULL is casting NULL as a pointer to a char *NOT* a pointer to the value of NULL. A pointer whose value is NULL is not usually meaningfull (is it ? ). If , as I think you mean , you want to pass a POINTER to a character whose value is NULL you should use (char *) &(NULL). I can not comment on why (char *) variable works but I question the whole reason for wanting to pass a null pointer except as an error condition for a function like malloc(). The reason , I think, that (char *) NULL does not work is that it has no real meaning other than 'something is wrong'. Feel free to explain why I am wrong, if I am. Theo ten Brummelaar ---------------------------------------------------------------------------- C.S.I.R.O. Division of Applied Physics , Linfield , Sydney , Australia. ---------------------------------------------------------------------------- Time flies like an arrow , fruit flies like an orange. ---------------------------------------------------------------------------- ACSnet: theo@natmlab CSNET: theo@natmlab.oz ARPA: theo%natmlab.oz@seismo.css.gov JANET: natmlab.oz!theo@ukc UUCP:{enea,hplabs,mcvax,prlb2,seismo,ubc-vision,ukc}!munnari!natmlab.oz!theo ----------------------------------------------------------------------------