POV-Ray : Newsgroups : povray.off-topic : Quick C language-lawyer question... : Re: Quick C language-lawyer question... Server Time
5 Sep 2024 11:25:00 EDT (-0400)
  Re: Quick C language-lawyer question...  
From: Fredrik Eriksson
Date: 30 Jul 2009 16:39:33
Message: <op.uxweb7gw7bxctx@e6600>
On Thu, 30 Jul 2009 22:14:16 +0200, Darren New <dne### [at] sanrrcom> wrote:
> In other words, neither guarantees that the bit pattern in memory for  
> NULL is actually all zeros, right?

Right.


> So using memset() to clear a structure to 0 that contains pointers isn't  
> guaranteed to be portable to something like the AT&T 3B2, where NULL !=  
> 0x0 in memory?

Assuming that you want the pointers to have null pointer values, it is  
only portable to architectures that explicitly specify an all-zero bit  
pattern for null pointers.


> I looked, but all I found were references to "null pointer value", and  
> not any bit patterns.

The standard does not specify any particular bit pattern, so naturally  
there is no mention of such things.



-- 
FE


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.