As you probably expected, the new "Integer(n)" types have some bugs left, among them a really bad one:
The following program causes an internal compiler error (Linux) or causes gpc to crash with page fault (DJGPP), sometimes it hangs. It did even manage to hang Linux, when running in DosEmu!!! That's not easy! )-:
unit x;
interface
type Card8=Cardinal(8);
implementation end.
Some more bugs with "Integer/Card/Word(n)":
Is "Integer(n)" supposed to support bigger types than LongestInt? If not, gpc should give an error if n is too big, otherwise the following things are bugs.
The following program writes 0. ("+" doesn't seem to work correctly with big integers at all, telling from the asm code.)
program x; var a:integer(128); begin a:=$FFFFFFFF; a:=a+1; writeln(integer(a)) end.
The following program writes "garbage":
var x:cardinal(8); begin x:=31; writeln(x); end.
With this one, gpc says "initializer element is not constant":
program x; var a:integer(128) value 0; begin end.
At least "=" seems to work with these types, which would make "Cardinal(128)" usable for ClassIDs (I hope)... :-)
Also, the n in "Integer(n)" seems to be handled modulo 256. If types >256 bits are not supported, an error should be given.
Besides, I'm not too sure if "Integer(0)" is reasonable... ;-)
And now for something completely different...
Peter Gerwinski wrote:
A new option `--executable-file-name' or (*$executable-file-name="foo"*)
Doesn't work if no "program name;" is given, i.e. x.p with "program y;" results in x, but x.p without any "program" results in a.out.
- Subrange types can be packed now:
Works "strangely" in some situations. The following gives 8, but replacing "packed 1..6" by "byte" yields 2 (the program with a packed record gives 1, as it should, however).
program x; var z:record a:packed 1..6; b:packed 1..6 end; begin writeln(sizeof(z)) end.
The following writes "xb" (I'm not completely sure how arrays of char are handled in EP, but I'd expect either "x" or "xbc"):
program x; Var x:array[0..64] of Char; Begin x:='abc'; x:='x'; writeln(x) End.
But apart from these things, a lot of bugs have disappeared! :-)