Lähettäjä: Kjetil Torgrim Homme Päiväys: Vastaanottaja: Michael J Tubby B.Sc. G8TIC Kopio: exim-users Aihe: Re: [exim] Off-topic coding style
On Wed, 2006-10-11 at 10:04 +0100, Michael J Tubby B.Sc. G8TIC wrote: > Secondly, I think this is academic, as on the subject of null pointers K&R
> say: "The symbolic constant NULL is often used in place of zero, as a
> mnemonic to indicate more clearly that this is a special value for a
> pointer. NULL is defined in <stdio.h>" [1]
>
> So the only time our bzero(), memset() to zero, setting to interger zero,
> etc. would unravel is if you have a (strange?) compiler/environment that has
> a definition for NULL of other than zero in <stdio.h>
you can always use the integer 0 in place of the macro NULL. this does
*not* imply that the null pointer is stored bitwise in memory as
0000000, it only means that the compiler needs to accept
ptr = 0;
and translate it into the magic
LOAD ptr, #8000:7fff
or similar assembly. the null pointer bit pattern can even vary with
type! the compiler can not catch and make this translation in memset,
since that is truly setting the memory to the exact bit pattern you
specify.
all this standard lawyering aside, I think it is perfectly acceptable
for Exim to require the target architecture to have null pointers which
are bitwise zero.
--
Kjetil T.