The GNU Pascal Compiler (GPC) does not yet implement the whole ISO 10206 Extended Pascal standard, not even the whole ISO 7185 Pascal standard. It is only partially compatible to Borland Pascal and implements only some isolated features from the PXSC standard. Furthermore, there are lots of known bugs which will take a long time to be fixed. (Any help welcome!) Please take this into account when you consider using GPC for any purpose.
If you encounter a bug with GPC, please check whether it is one of the
known bugs. If not, report it to the GNU Pascal mailing list
gpc@hut.fi
. (But always report it if you solve the problem! ;-)
GPI
mechanism crashes when compiling some Modules, for
example the System
module by Berend de Boer.
Workaround:
Include the Unit or Module into the main program's source:
(*$I MyModule *) Program MyProg; uses MyModule; ...
gpc
is invoked for linking only, it crashes on some
systems.
Workaround: Use gcc
instead of gpc
for
linking:
gpc -c hello.pas gcc -o hello hello.o -lm -lgpc
.gpc
files are not removed after compilation.
Type WrkString = String ( 80 ); Procedure Foo ( S: WrkString );instead of
Procedure Foo ( S: String );
str:='1234567890'; i:=8; j:=13; str:=str[i..j];
Var C: Char; S: String ( 80 ); i: Integer; ... i:= Index ( s, c ); (* "i" always zero *)It works with `Var C: String ( 1 );'
See section From Borland Pascal to GNU PascalQuickStart Guide for Borland Pascal users.
contrib
subdirectory
of your GPC distribution.
Type Extended = __long__ Real; Var foo: Extended; [...] writeln ( Real ( foo ) );
(void *)
pointer, so you have to cast it in order to output the
object the pointer points to.
Also, we have not tried any other debugger than `gdb'. If you do,
please let us know what happens.
I think that GDB does not yet support the kind of `.stabs'
that should be used to do this correctly:
.stabs ":tanumber=bnumber", whateverwhere anumber is the unknown pointer type referenced earlier, and the bnumber is the type which anumber actually is. This construct is not required in C.
Procedure FooBAR(i:integer);c;This makes the external name to be `_foobar' (replace
_
with you machine prefix.)
Procedure FooBAR(i:Integer); External;Uses external name
_Foobar
.
It is done like this to reduce name clashes
with `libc.a' and other possible libraries.
_p_...
.