From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,12b6bb94ebde41c X-Google-Attributes: gidfee84,public From: Dan.Pop@cern.ch (Dan Pop) Subject: Re: Dereferencing NULL pointer? Date: 1997/05/23 Message-ID: #1/1 X-Deja-AN: 243425681 Sender: news@news.cern.ch (USENET News System) X-Nntp-Posting-Host: ues5.cern.ch References: <5lteva$q0e@charnel.ecst.csuchico.edu> <5m239e$ajk@charnel.ecst.csuchico.edu> Organization: CERN European Lab for Particle Physics Newsgroups: comp.unix.osf.osf1 In <5m239e$ajk@charnel.ecst.csuchico.edu> tsaylor@ecst.csuchico.edu (Todd M. Saylor) writes: >These things I already know, so I think I'll skip the advice to read a >C book. We are porting a "million line plus" application, not just a >single program, so what we are really hoping for is some way of treating >the NULL pointer as a pointer to a NUL character. This is the way it >ends up working on the other platforms we've used (yes, I know the results >are technically undefined, but many platforms have linker switches or other >tricks to allow this). Blame it on legacy code. Dereferencing a null pointer (yeah, "null" is spelled in lower case in this context) is a BUG. And bugs are fixed, not worked around. Legacy code is not an excuse for sloppiness. Dan -- Dan Pop CERN, IT Division Email: Dan.Pop@cern.ch Mail: CERN - PPE, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland