Re: [fpc-devel] Are global variables guaranteed to be zero?

2013-02-20 Thread Frank Church
On 29 November 2012 10:08, Alexander Klenin kle...@gmail.com wrote: On Wed, Nov 28, 2012 at 2:29 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: Will global variables and static global arrays be always initialized to zero? Yes. Then I suggest to amend the first paragraph of

Re: [fpc-devel] Are global variables guaranteed to be zero?

2013-01-24 Thread Mark Morgan Lloyd
Apologies for revisiting an old thread. michael.vancann...@wisa.be wrote: Will global variables and static global arrays be always initialized to zero? Yes. Are there cases where locals are set to a sane initial state, e.g. for strings and dynamic arrays? What about (references to)

Re: [fpc-devel] Are global variables guaranteed to be zero?

2012-11-29 Thread Alexander Klenin
On Wed, Nov 28, 2012 at 2:29 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: Will global variables and static global arrays be always initialized to zero? Yes. Then I suggest to amend the first paragraph of http://www.freepascal.org/docs-html/ref/refse22.html which directly contradicts

Re: [fpc-devel] Are global variables guaranteed to be zero?

2012-11-29 Thread michael . vancanneyt
On Thu, 29 Nov 2012, Alexander Klenin wrote: On Wed, Nov 28, 2012 at 2:29 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: Will global variables and static global arrays be always initialized to zero? Yes. Then I suggest to amend the first paragraph of

Re: [fpc-devel] Are global variables guaranteed to be zero?

2012-11-29 Thread LacaK
Alexander Klenin wrote / napĂ­sal(a): On Wed, Nov 28, 2012 at 2:29 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: Will global variables and static global arrays be always initialized to zero? Yes. Then I suggest to amend the first paragraph of

Re: [fpc-devel] Are global variables guaranteed to be zero?

2012-11-29 Thread Mark Morgan Lloyd
michael.vancann...@wisa.be wrote: On Thu, 29 Nov 2012, Alexander Klenin wrote: On Wed, Nov 28, 2012 at 2:29 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: Will global variables and static global arrays be always initialized to zero? Yes. Then I suggest to amend the first paragraph of

Re: [fpc-devel] Are global variables guaranteed to be zero?

2012-11-29 Thread michael . vancanneyt
On Thu, 29 Nov 2012, Mark Morgan Lloyd wrote: michael.vancann...@wisa.be wrote: On Thu, 29 Nov 2012, Alexander Klenin wrote: On Wed, Nov 28, 2012 at 2:29 PM, Jonas Maebe jonas.ma...@elis.ugent.be wrote: Will global variables and static global arrays be always initialized to zero? Yes.

Re: [fpc-devel] Are global variables guaranteed to be zero?

2012-11-29 Thread Mark Morgan Lloyd
michael.vancann...@wisa.be wrote: You must initialize local variables. Are there cases where locals are set to a sane initial state, e.g. for strings and dynamic arrays? What about (references to) objects? Managed types are normally initialized. That means Ansistrings, UnicodeString, and

Re: [fpc-devel] Are global variables guaranteed to be zero?

2012-11-29 Thread michael . vancanneyt
On Thu, 29 Nov 2012, Mark Morgan Lloyd wrote: michael.vancann...@wisa.be wrote: You must initialize local variables. Are there cases where locals are set to a sane initial state, e.g. for strings and dynamic arrays? What about (references to) objects? Managed types are normally

Re: [fpc-devel] Are global variables guaranteed to be zero?

2012-11-29 Thread Hans-Peter Diettrich
michael.vancann...@wisa.be schrieb: Are there cases where locals are set to a sane initial state, e.g. for strings and dynamic arrays? What about (references to) objects? Managed types are normally initialized. That means Ansistrings, UnicodeString, and COM interfaces and dynamic arrays

Re: [fpc-devel] Are global variables guaranteed to be zero?

2012-11-28 Thread Jonas Maebe
On 28 Nov 2012, at 08:47, Alexander Klenin wrote: Will global variables and static global arrays be always initialized to zero? Yes. Jonas ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

[fpc-devel] Are global variables guaranteed to be zero?

2012-11-27 Thread Alexander Klenin
Will global variables and static global arrays be always initialized to zero? It seems that they in fact are, and there is quite a lot of code relying on it. On the other hand, the documentation denies that. What is the official position? -- Alexander S. Klenin