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: Craig Neth USG Subject: Re: Dereferencing NULL pointer? Date: 1997/05/29 Message-ID: <338DE9DA.ABD@zk3.dec.com>#1/1 X-Deja-AN: 244797309 References: <5lteva$q0e@charnel.ecst.csuchico.edu> To: "Todd M. Saylor" Organization: Digital UNIX Development Environment Group Newsgroups: comp.unix.osf.osf1 Todd M. Saylor wrote: > > I am currently in the process of porting an application to Digital UNIX > 4.0b (it's never been run on an alpha before).The app runs fine on HP/UX, > AIX, DG/UX (motorola and Intel), AT&T/NCR. One problem has come up on > previous ports, that is the ability to dereference a NULL pointer. [... example deleted ...] > Now this may be bad form, but I was wondering if anyone knows of a > switch/option to allow it? I'll skip the lecture and tell you how to make it work: link with sys5 library, ala: # cc null.c -lsys5 # a.out Null string = '(null)' Null Char = '' The libsys5 library includes an init procedure which makes a syscall that maps the page at address zero. -- -------------------------------------------------------------------------------- Craig Neth ! neth@zk3.dec.com DIGITAL Equipment Corporation ! 110 Spit Brook Road ZKO3-3/W17 ! Nashua, NH 03062 ! Opinions expressed herein are my own. ================================================================================