const keyword: problems migrating code from gpc on Linux to gpc on OsX
Hi all. The follwing three files reproduce an error I've encountered while porting some code from gpc on Linux to gpc on OsX. ----------- file p1.pas -------- module p1; export p1 = all; const P = 155; function Something() :boolean; end; function Something: boolean; begin Something := false; end; end. ------------ file p2.pas --------- module p2; export p2 = all; const P = 155; function SomethingElse :boolean; end; function SomethingElse: boolean; begin SomethingElse := false; end; end. ----------- file testconst.pas ------- program test(input, output); import p1;p2; var a,b : boolean; c : integer; begin a := Something; b := SomethingElse; c := P; writeln('test'); end. --------------------------------------------------- If I try gpc --automake testconst.pas on my linux box it works fine. If I try the same command on my Mac I receive the following output: p2.pas:5: error: redeclaration of `P' p1.pas:5: error: previous declaration Please note that if you change both P and c to boolean type, everything works fine both on Linux and OsX Precisely, on Linux I am running gpc 20041218 based on gcc-3.3.3. On the Mac I run GNU Pascal version 20041218, based on gcc-3.4.3, i.e. the one currently available on microbizz. Any hint? Thanks, Stefano
participants (2)
-
Stefano Carpin -
Waldek Hebisch