disable_dynamic_updates report

Gary E. Miller gem at rellim.com
Thu Aug 29 21:36:40 UTC 2019


Yo Hal!

> On Thu, 29 Aug 2019 14:06:25 -0700
> Hal Murray via devel <devel at ntpsec.org> wrote:
> 
> > >> By "floating", you mean uninnitialized?  In C that's going to
> > >> mean it's     
> > false
> >   
> > > Yes. My understanding of C is that anything not explicitly set has
> > > whatever random value happens to be in that memory location.
> > > Possibly  changed if certain unknown compiler options are chosen.
> > >     
> > 
> > I thought global variables were initialized to zero.  
> 
> 
> C11 states, page 12, section 5.1.2.2:
> 
> "All objects of static storage duration shell be initialized (set to
> their initial values) before program startup.  The manner and timing
> of such initializations are otherwise unspecified."
> 
> In this case, as defined in 6.2.4, "static" just means always
> allocated (not on the stack, etc.).
> 
> So, IMHO, you can't expect zeros.

Correction.  My mistake.  

Hal you are corect.  Page 140, section 6.7.9 Initialization.

"If an object that has static or thread storage duration is not initialized
explicitly, then:
[...]
-- if it has arithmetic tye, it is initialized to (positive or unsigned)
zero;"

So static storage items are initialized for at least C11.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20190829/7f91903f/attachment-0001.bin>


More information about the devel mailing list