From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,f79df321ef1d2c00 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1992-06-18 17:43:14 PST Newsgroups: comp.sys.dec Path: sparky!uunet!decwrl!world!cmr From: cmr@world.std.com (Charles M Richmond) Subject: Re: Porting to Alpha VMS Message-ID: Organization: Integrated International Systems Corp. One Longfellow Place, Suite 3309, Boston, Ma. References: <1992Jun16.131316.23012@nntpd.lkg.dec.com> <1992Jun17.101358.2044@lsl.co.uk> <1992Jun18.102322.2054@lsl.co.uk> <11q1opINNrmv@grapevine.EBay.Sun.COM> Date: Fri, 19 Jun 1992 02:27:19 GMT smckinty@sunicnc.France.Sun.COM (Steve McKinty - Sun ICNC) writes: >In article <1992Jun18.102322.2054@lsl.co.uk>, robin@lsl.co.uk (Robin Fairbairns) writes: > > In article , cmr@world.std.com (Charles M Richmond) writes: > > > > > > One of the gotchas that I ran into in a major port from Vax/Ultrix to > > > Risc/Ultrix (more than 750,000 lines), was that the coders had used > > > the availability of address "0" to skip checks for null pointers. The > > > other problem was that structures were cast as byte streams and vice > > > versa, which enforced the coders idea of how the structures were packed. > > > > Quoting from my (non-final) copy of the C standard, para 3.2.2.3: "An > > integral constant expression with the value 0, or such an expression > > cast to type void *, is called a _null pointer constant_. .... Such a > > pointer, called a _null pointer_, is guaranteed to compare unequal to > > any object or function." > > >I suspect the problem isn't with null pointer constants, but with pointers >containing a zero value. If you dereference such a pointer (and thus access >location zero) the standard doesn't say what will happen. On a VMS VAX you'll >get an memory access violation, because the first 512 bytes are intentionally >inaccessible to catch this sort of error/laziness. ..... >Steve BINGO! Charlie -- ***************************************************************************** * * * Charles Richmond International Integrated Systems Corporation * * One Longfellow Place Suite 3309 , Boston , Ma. USA 02114-2431 *