Path: utzoo!attcan!uunet!husc6!cca!g-rh From: g-rh@cca.CCA.COM (Richard Harter) Newsgroups: comp.lang.c Subject: Re: Let's define our own NULL II Message-ID: <29871@cca.CCA.COM> Date: 24 Jun 88 03:56:19 GMT References: <162@navtech.uucp> Reply-To: g-rh@CCA.CCA.COM.UUCP (Richard Harter) Organization: Computer Corp. of America, Cambridge, MA Lines: 24 In article <162@navtech.uucp> mark@navtech.uucp (Mark Stevans) writes: >So far, most responders to the article I posted on Wednesday have not addressed >my question. I am not asking about what is a legal definition of NULL. I am >asking whether one should define NULL in a product-wide header file *just* so >that people won't have to includeif they only need a definition of >"NULL" in a module. Mark summarizes arguments pro and con. I won't argue one way or the other as to whether it's the right thing to do, but here's what we did and why. In our standard header file we define null as 0 (note lower case) with the standard meaning that it is a null pointer. This takes care of all conflict problems without playing ifdef games at the price, of course, of adding a nonstandard keyword. We specifically rejected the notion of including stdio.h in all files, partly on methodological prejudices, and partly because our software runs on a variety of operating systems. Fopen and kin vary in treatment across operating systems; life is much simpler if calls to these routines are carefully isolated and are explicitly noted. -- In the fields of Hell where the grass grows high Are the graves of dreams allowed to die. Richard Harter, SMDS Inc.