Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ames!ucbcad!zen!cory.Berkeley.EDU!iverson From: iverson@cory.Berkeley.EDU (Tim Iverson) Newsgroups: comp.sys.ibm.pc Subject: Re: ** Re: MSC 4.0 Large Model ** Original Posters problem solved!!! Message-ID: <3370@zen.berkeley.edu> Date: Sat, 22-Aug-87 01:25:26 EDT Article-I.D.: zen.3370 Posted: Sat Aug 22 01:25:26 1987 Date-Received: Sun, 23-Aug-87 08:26:58 EDT References: <10400006@altger.UUCP> <72@cunixc.columbia.edu> <1014@bsu-cs.UUCP> <3352@zen.berkeley.edu> <4291@teddy.UUCP> Sender: news@zen.berkeley.edu Reply-To: iverson@cory.Berkeley.EDU.UUCP (Tim Iverson) Organization: University of California, Berkeley Lines: 38 In article <4291@teddy.UUCP> jpn@teddy.UUCP (John P. Nelson) writes: >>A cast is necesary for a comparison with large model pointers in >>both lattice C and MSC4.0 ... > >I can't believe how much BAD information gets posted here. If you don't >know the answer, then DON'T POST!!!!! Well, this time I guess my fingers did my thinking for me ... I recalled previous postings about this and the fact that in large model NULL is 0L on MSC and Lattice and then added two and two and came up with three - basically that why would they define it to 0L unless they needed to? I cut myself while wielding Occam's razor. When I first saw this mild flame I thought, ah ha!, now I've got 'im. So I wrote a little program to test it out. Well, I'm wrong, John's right, MSC and Lattice both work fine comparing far (32bit) pointers to a short (16bit) 0. Although, in my defense, I must state that this is the first time I've posted such a stupid answer. >To summarize: when passing a null pointer to a function, you should >always cast the 0 or NULL to the proper pointer type. In any other >context, you may use 0 or NULL interchangably. Yes. This is just good programming practice. There are so many habits I've had to force myself into (to maintain portability between unix and msdos) once I started programming in MS-DOS, that I thought casting 0 was required. Sorry for the misinformation. - Tim Iverson iverson@cory.Berkeley.EDU ucbvax!cory.Berkeley.EDU p.s. For those of you who write insulting letters, save it for when we stand face to face ... (say, at dawn w/ bare hands - weapons are for wimps >:-)