[fpc-pascal] Initializing records and other complicated structures

Graeme Geldenhuys graemeg.lists at gmail.com
Wed Sep 29 10:30:08 CEST 2010

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 that they will not change the Fill*()
functions parameters to being out parameters (some Windows OLE or COM
thing). What I had to do was create my own wrapper function for
Fill(), then inside that wrapper function I called FillChar or
FillByte etc, and that call is wrapped by {$HINT OFF} and {$HINT ON}
directives.  A bit of a pain, but it worked, and I silenced the
compiler warning.

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the fpc-pascal mailing list