[mod.computers.vax] Solution to NULL problem for all you C programmers

info-vax@ucbvax.UUCP (02/05/86)

I just don't see what the big deal is with all the NULL pointer
dereferencing...

Either you fix the code to never reference a null pointer, which is considered
by many to be a good idea, and is the reason VMS doesn't map page 0, or
you just ask VMS to let you use page 0.

Personally, I'd take the first tack when writing code, but the second when
bringing crufty code over.  It's really trivial, and here's a sample Pascal
program to map page 0.  Make the call at the beginning of "main", and
everything should be fine...

	/Kevin Carosso           engvax!kvc @ csvax.caltech.edu
	 Hughes Aircraft Co.

------------------------------------------------------------
[inherit ('SYS$LIBRARY:STARLET')]
program t;

var
  page_number : array [0..1] of integer := (0,0);
  stat : integer;

begin
  stat := $CRETVA (INADR := page_number);
end.