[fpc-devel] compiler bug?

Jose Manuel qkysoft at arrakis.es
Fri Dec 31 18:40:19 CET 2004


>
> > >  else
> > >     WriteLn('Other');
> >
> > This better should read:
> > 	WriteLn('corrupt data space!!!'); Panic;
>
> Much more useful :->

(AFAIK) you do.
You're programing, the C way.

You can't expect that -1 equals True, and any other value equals false, (I
really dunno, but I think I  could remember that) in Visual Basic is 1
instead of -1). As far as I can know Boolean type is in Pascal, that, a
type. I think there's no specifation how the compiler (ANSI PASCAL, ANSI
PASCAL 2) should implement that. (IMHO bad programming pratice)

If anyone goes on wild (and explicity) casting integer, enumerated, etc..
types into booleans, of course, many things may happen. But I reiterate, as
far as I can know, that is compiler implementation dependent, and one can't
depend on it.

Hower, should my opinion serve to anybody, I think that Kylix, Borland anf
FPC (according to contionals Delphi, ObjFpc, etc) should share the same
behoviour. As long as compatibility is broken between Delphy and Kylix, it's
up to you.

But, and I beg everyone's pardon if I' too dork, This is Pacal, Not C. I
can't really find out why I would need ro cast Boolean(Integer(255)= into a
boolean, and I guess that if I knew, I would surely programming in C.






More information about the fpc-devel mailing list