Hi all,
It seems that a new bug has crept in in recent versions of gpc (I use 2.1 / djgpp). I found it in recompiling a program which worked correctly some times ago.
A simple program to display the bug is obtained by splitting the docdemos/operatordemo.pas program into a main and a unit:
-----------------------------------------------------------------
program bugoper;
uses uoper;
var a, b, c: Vector3 = (1, 2, 3);
begin c := a + b end.
-----------------------------------------------------------------
unit uoper;
interface
type Vector3 = record x, y, z: Real; end;
operator + (u, v: Vector3) w: Vector3;
implementation
operator + (u, v: Vector3) w: Vector3; begin w.x := u.x + v.x; w.y := u.y + v.y; w.z := u.z + v.z; end;
end.
-------------------------------------------------------------------
I obtain the following error mesage
bugoper.pas: In main program: bugoper.pas:10: invalid operands to binary + bugoper.pas:10: invalid operands to binary +
Everything is correct of course with the original program
Maurice