[fpc-devel]Fwd: May be a bug in FPC 1.0.4

grizly_ru at mail.ru grizly_ru at mail.ru
Sat Oct 6 15:56:00 CEST 2001

Oh, mama mia! Excuse me! This is my bug, not a FPC's one! :)))
Don't think I wrote you a mail just after I found some problems: I
tried to correct this bug few hours! Excuse me!

===8<==============Original message text===============
Hello, developers,

I think, I have been found a bug in FPC 1.0.4. In OBJFPC mode the
boolean type fields of some record work strange. F.e.:

 sc = record
   d: boolean;
 psc = ^sc;

 l: TList;
 a: psc;

for i:=0 to x do begin new(a); a^.d:=false; l.Add(a); end;
for i:=0 to l.Count-1 do if Anything then a(l.Items[i])^.d:=not
for i:=0 to l.Count-1 do if a(l.Items[i])^.d then DoSomething; //here
//the values of d field are incorrect, but values of other fields are

I made in my program operations like these. l object and psc type are
declared in a global definitions unit (used in every other unit in
program). a variable is declared in current unit.
I initialize l in one unit, and use in in another one. But
from the other unit (and also outside the for..do where I initialize
l, but in the same unit) the values of boolean field are incorrect.
Values of other type fields are correct. At the end I used char type
instead of boolean ('Y'=true 'N'=false) and with chars all worked

Best regards,
 grizly                          mailto:grizly_ru at mail.ru

===8<===========End of original message text===========

Best regards,
 grizly                            mailto:grizly_ru at mail.ru

More information about the fpc-devel mailing list