New bug in gpc 2.1 ?

Maurice Lombardi Maurice.Lombardi at ujf-grenoble.fr
Sat Aug 3 10:33:00 CEST 2002


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


-- 
        Maurice Lombardi
Laboratoire de  Spectrometrie Physique,
Universite Joseph Fourier de Grenoble, BP87
38402 Saint Martin d'Heres Cedex     FRANCE
Tel: 33 (0)4 76 51 47 51
Fax: 33 (0)4 76 63 54 95
mailto:Maurice.Lombardi at ujf-grenoble.fr




More information about the Gpc mailing list