Microport Unix -- Large Model Problems

Daniel M. Frank dan at prairie.UUCP
Tue Nov 4 00:32:33 AEST 1986


In article <245 at rabbit1.UUCP> barber at rabbit1.UUCP (Steve Barber) writes:
>Another common problem is passing NULL as pointer argument.  NULL is
>#defined as 0, which is 2 bytes.  Large model pointers are 4 bytes, so
>the stack frame is now basically garbage.

   This isn't really true.  Code in stdio.h for the SV/286 release
checks your memory model, and if it is large, defines NULL to be 0L,
which is the same size as a pointer.  It doesn't please lint, so the
best solution is still to cast it as appropriate (like (char *)0),
but you ARE generally safe, as long as you include stdio.h.


-- 
    Dan Frank
    uucp: ... uwvax!prairie!dan
    arpa: dan%caseus at spool.wisc.edu



More information about the Comp.unix.wizards mailing list