Re: [fpc-pascal] Initializing records and other complicated structures

2010-09-29 Thread Sven Barth
Am 28.09.2010 21:03, schrieb Vincent Snijders: 2010/9/28 Jürgen Hestermannjuergen.hesterm...@gmx.de: Sven Barth schrieb: It's enough code, because FillByte (and others) are defined with a var parameter and such the hint (not a warning) won't go away. It's an old topic already and we have just

Re: [fpc-pascal] Initializing records and other complicated structures

2010-09-29 Thread Graeme Geldenhuys
On 27 September 2010 10:26, Jim wrote: FillByte(tag, SizeOf(tag), 0); //initialize var. The compiler warning doesn't go away though. I've had the same problem a few monts ago, and I hate compiler hints/warnings in my code. The issue is the var parameters, and the FPC developers already stated

[fpc-pascal] Initializing records and other complicated structures

2010-09-29 Thread _-jane-_
It seems that we need a new parameter modifier out_non_finalize since out includes a finalization. We had a similar discussion with constref. Maybe we need a comprehensive method to describe calling conventions, see e.g. http://mantis.freepascal.org/view.php?id=16697 or the discussion about in

Re: [fpc-pascal] Initializing records and other complicated structures

2010-09-29 Thread Jürgen Hestermann
Sven Barth schrieb: But why not simply change the definition of the variable to out? Then the Fill* functions would be recognized as initializing routines. No, see http://bugs.freepascal.org/view.php?id=17020 @Jürgen: That's what I meant, when I said it's an old topic. ;) Yes, I see now.

Re: [fpc-pascal] Initializing records and other complicated structures

2010-09-28 Thread Jim
On 27-9-2010 13:30, Sven Barth wrote: Am 27.09.2010 10:38, schrieb Honza: 2010/9/27 Jimhakki...@gmail.com: As TIfdTag seems to contain non-pointer records only, I thought I could use Sizeof and tried this: FillByte(tag, SizeOf(tag), 0); //initialize var. The compiler warning doesn't go away

Re: [fpc-pascal] Initializing records and other complicated structures

2010-09-28 Thread Jürgen Hestermann
Sven Barth schrieb: It's enough code, because FillByte (and others) are defined with a var parameter and such the hint (not a warning) won't go away. It's an old topic already and we have just to live with it (regarding the Fill* functions). ^^ But why not simply change the definition of the

Re: [fpc-pascal] Initializing records and other complicated structures

2010-09-28 Thread Vincent Snijders
2010/9/28 Jürgen Hestermann juergen.hesterm...@gmx.de: Sven Barth schrieb: It's enough code, because FillByte (and others) are defined with a var parameter and such the hint (not a warning) won't go away. It's an old topic already and we have just to live with it (regarding the Fill*

[fpc-pascal] Initializing records and other complicated structures

2010-09-27 Thread Jim
Hi, Fpc sometimes complains (hints) about local variables not being initialized. My question: how do I initialize more complicated structures like records? And should I need to (I'm guessing no in the example below, but the contents of the record will be undefined - no problem as there are no

Re: [fpc-pascal] Initializing records and other complicated structures

2010-09-27 Thread Honza
2010/9/27 Jim hakki...@gmail.com: Fpc sometimes complains (hints) about local variables not being initialized. My question: how do I initialize more complicated structures like records? And should I need to (I'm guessing no in the example below, but the contents of the record will be undefined

Re: [fpc-pascal] Initializing records and other complicated structures

2010-09-27 Thread Sven Barth
Am 27.09.2010 10:38, schrieb Honza: 2010/9/27 Jimhakki...@gmail.com: As TIfdTag seems to contain non-pointer records only, I thought I could use Sizeof and tried this: FillByte(tag, SizeOf(tag), 0); //initialize var. The compiler warning doesn't go away though. Is this the recommended way of