[fpc-devel]SizeOf() reports 0 for Var Paramaters. (1.1)

Jon Sawyer bq at badquanta.net
Sun Jul 27 21:08:35 CEST 2003

> > Fpc 1.0.6's SizeOf used to report 4 (regardless of the size of the
> 1.0.10 also report 4. 1.1 reports 0.
> > parameter actually passed) and I submitted a bug report, so it was fixed:
> > http://www.freepascal.org/bugs/showrec.php3?ID=2561
> > http://www.freepascal.org/bugs/showrec.php3?ID=2562
> These say that it is fixed in 1.1, and that's true, I verified this.
> Probably Peter only fixed it in 1.1, because he considered it a minor bug (
> code that relies on this is IMHO severly broken).

Funnily enought all the times I tested it on 1.0.6 I was using DWords and 
Pointers.. I tried my array w/ Bytes/Words and never had any problems 
(because my array simply stored the var and just had a few extra padding 
bytes)  I never really ran into the problem.  

I just noticed now w/ 1.1 because nomater what Index I gave my array it 
allwasy returned the same number,  Later I tracked it down to the array 
thinking all the items were of 0 size.  ie: iIndex*iItemSize = 0.  I've fixed 
the problem by requireing the programer to pass the size of his item in 
Create() but I think if it is possible, that would be a nifty feature. 

More information about the fpc-devel mailing list