On 11/08/16 13:15, Robert Story wrote:
> On Tue, 8 Nov 2016 13:02:51 -0800 Bart wrote:
> BVA> On 11/08/2016 12:17 PM, Robert Story wrote:
> BVA> > Static buffers/arrays should be initialized before use. If
> BVA> > you find any that are used before they are initialized,
> BVA> > please file a bug and, if you can, submit a patch to fix
> BVA> > them.
> BVA>
> BVA> Hello Robert,
> BVA>
> BVA> A quote from the C language standard (ISO/IEC 9899:201x):
> BVA> "6.9.2 External object definitions. [...]"
> BVA>
> BVA> In other words, any toolchain that does not zero-initialize
> BVA> static variables violates the C standard. I don't think we
> BVA> should care about broken toolchains.
>
> Is that new in 201x? How far back does this go in the standards?
> It's been a while, but the last time we discussed it, I believe the
> decision was made to support C89 an later. I might have missed a
> recent decision if that has changed, and of course we can revisit
> that if enough folks agree we should.

Hello Robert,

That requirement is not new. This is what I found in my copy of the K&R 
C book (2nd edition):

"In the absence of explicit initialization, external and static 
variables are guaranteed to be initialized to zero; automatic and 
register variables have undefined (i.e., garbage) initial values."

Appendix C (Summary of Changes) does not mention anything about static 
variables so I think this requirement exists since the very beginning of 
the C programming language.

Bart.

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to