How do a write portable programs?
Daniel E. Wilson;1432;58-790;;
danw at tekchips.CRL.TEK.COM
Sat Sep 10 15:57:31 AEST 1988
In article <2515 at ingr.UUCP> jones at ingr.UUCP (Mark Jones) writes:
>In article <1056 at nmtsun.nmt.edu>, warner at hydrovax.nmt.edu (M. Warner Losh) writes:
>Instead of using NULL, use ZERO, and don't worry about casting it. [Because
>K&R guarantees that `0' denotes a null pointer constant.]
I for one have problems with this. There is an Intel C compiler that
will not handle 0 for a NULL pointer in the large memory model. This is
due to the lack of argument checking in K&R C. (C++ is much better.)
If you wish for a program to be portable do this:
#define NIL(type) ((type *) 0)
Always use this function and you avoid the problem.
--------------
Dan Wilson <shadow at tekfdi.FDI>
These opinions are my own.
My manager would prefer that I didn't have opinions.
More information about the Comp.lang.c
mailing list