gpc --version
is not coherent among different versions of gpc, i.e. they do not provide me with output that is comparable to each other. I have access to one gpc installation that is on a sparc system. It gives me the output:
gpc --version 2.8.1
This is a very laconic output compared to the one I get on my cygwin version (I was installing a binary distribution):
gpc --version gpc 20030323, based on gcc-3.2.2 Copyright (C) 1987-2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This output also reveals that gpc is based on gcc. However, I thought gpc was a freestanding compiler that did not precompile anything (according to "The GNU Pascal Manual", which is something I was able to get in PDF). Is it based on gcc or not?
Now on the 2.8.1 system, I have problems compiling source that uses the extension "external" in combination with a "name" directive like this:
procedure foo; external name 'foo';
I have to keep it like this instead:
procedure foo; external;
However, this means that I come in trouble when I want to compile source that some people have made.
My questions are:
How is the version system working with gpc? Which is the latest stable gpc and does it use the "extern name 'foo'" extension? Which is the latest unstable gpc? How unstable is it? Is there a switch to actually enable "extern name 'foo' in all versions?
Thanks a lot for your attention, and I also want to thank the people that already have helped me on this list.
/Anders
Anders Lindén wrote:
gpc --version
is not coherent among different versions of gpc, i.e. they do not provide me with output that is comparable to each other. I have access to one gpc installation that is on a sparc system. It gives me the output:
gpc --version 2.8.1
Until some years ago, it wrote only the backend version. It's safe to assume that any version that does so is too old for practical purposes today.
gpc --version gpc 20030323, based on gcc-3.2.2 Copyright (C) 1987-2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This output also reveals that gpc is based on gcc. However, I thought gpc was a freestanding compiler that did not precompile anything (according to "The GNU Pascal Manual", which is something I was able to get in PDF). Is it based on gcc or not?
Yes, it is based on gcc which means it shares the code generator wiith gcc. It does not means that it produces intermediate C code. Note that gcc means "GNU Compiler Collection", not "GNU C Compiler".
Now on the 2.8.1 system, I have problems compiling source that uses the extension "external" in combination with a "name" directive like this:
procedure foo; external name 'foo';
I have to keep it like this instead:
procedure foo; external;
However, this means that I come in trouble when I want to compile source that some people have made.
Yes, unfortunately this was one of the incompatible changes (actually, the most visible one) that had to be made at some point.
My questions are:
How is the version system working with gpc?
The most important information is the gpc version number (like 20030323) which older versions didn't write (see above). The backend version has no influence on the language features supported.
Which is the latest stable gpc
That's gpc 2.1 (2002-05-10).
and does it use the "extern name 'foo'" extension?
No, the old one.
Which is the latest unstable gpc?
20030830 (released yesterday :-).
How unstable is it?
On Linux/IA32 and DJGPP it should be about as stable as 2.1. The main difference is that such alpha releases are not tested so extensively on other platforms.
Is there a switch to actually enable "extern name 'foo' in all versions?
No. Previous versions have "asmname 'foo';". So you could do this (if you can change the sources). That's what, e.g., the Pascal units of the GRX library do. Eventually (I'd say, after the release of gpc 2.2, probably next year), the backward compatibility can be removed.
{$if __GPC_RELEASE__ >= 20030303} {$define asmname external name} {$endif}
procedure Foo; asmname 'foo';
PS: Please use line lengths < 80 chars.
Frank