Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: On Fri, 22 Jul 2016, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: Or better yet, the official documentation: http://www.freepascal.org/docs-html/current/rtl/system/default.html Question please. Using the official documentation as linked to above, how

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Bo Berglund
On Fri, 22 Jul 2016 08:12:01 +0200, Bo Berglund wrote: >>you need to assign it a value, you can assign it default(yourtype) >> > >Is "default" zero? >i.e. > >var > HD: TSSReadingHeader; > .. >begin > HD := Default(TSSReadingHeader); > >And now HD.anything is zero? I

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Michael Van Canneyt
On Fri, 22 Jul 2016, Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: Or better yet, the official documentation: http://www.freepascal.org/docs-html/current/rtl/system/default.html Question please. Using the official documentation as linked to above, how does one find out what

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: Or better yet, the official documentation: http://www.freepascal.org/docs-html/current/rtl/system/default.html Question please. Using the official documentation as linked to above, how does one find out what versions of the compiler/rtl/fcl support something?

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Michael Van Canneyt
On Fri, 22 Jul 2016, Mattias Gaertner wrote: On Fri, 22 Jul 2016 11:03:23 +0200 (CEST) Michael Van Canneyt wrote: On Fri, 22 Jul 2016, leledumbo wrote: OK, I did not know about the default keyword. Is "default" zero?

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Mattias Gaertner
On Fri, 22 Jul 2016 11:03:23 +0200 (CEST) Michael Van Canneyt wrote: > On Fri, 22 Jul 2016, leledumbo wrote: > > >> OK, I did not know about the default keyword. > >> > >> Is "default" zero? > > > >

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Michael Van Canneyt
On Fri, 22 Jul 2016, leledumbo wrote: OK, I did not know about the default keyword. Is "default" zero? http://wiki.lazarus.freepascal.org/FPC_New_Features_3.0#New_compiler_intrinsic_Default Or better yet, the official documentation:

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread leledumbo
> OK, I did not know about the default keyword. > > Is "default" zero? http://wiki.lazarus.freepascal.org/FPC_New_Features_3.0#New_compiler_intrinsic_Default -- View this message in context:

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Bo Berglund
On Mon, 18 Jul 2016 23:30:47 +0200 (CEST), Michael Van Canneyt wrote: >> Are there other commands it does detect as initialization of the >> variable? > >not that I know of. > >you need to assign it a value, you can assign it default(yourtype) > OK, I did not know about

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-18 Thread Michael Van Canneyt
On Mon, 18 Jul 2016, Bo Berglund wrote: On Mon, 18 Jul 2016 21:52:37 +0200 (CEST), Michael Van Canneyt wrote: Does not the FPC compiler reserve and zero the memory area of such variables? No. Does thios mean that the memory is reserved but not cleared or does it

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-18 Thread Bo Berglund
On Mon, 18 Jul 2016 21:52:37 +0200 (CEST), Michael Van Canneyt wrote: >> Does not the FPC compiler reserve and zero the memory area of such >> variables? > >No. Does thios mean that the memory is reserved but not cleared or does it mean that memory is not reserved at

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-18 Thread Michael Van Canneyt
On Mon, 18 Jul 2016, Bo Berglund wrote: I am getting compile hints "Local variable "" does not seem to be initialized" for a number of variables of packed record type. Does not the FPC compiler reserve and zero the memory area of such variables? No. In any case I am using Move() to fill

[fpc-pascal] Initialization of packed record local variables?

2016-07-18 Thread Bo Berglund
I am getting compile hints "Local variable "" does not seem to be initialized" for a number of variables of packed record type. Does not the FPC compiler reserve and zero the memory area of such variables? In any case I am using Move() to fill the variables with data from a binary buffer, maybe