This announcement is a bit late, as actually most of the web site
has been operating for a weeks now, but anyway.
I'm glad to announce that the complete GPC web site, including the
mailing list archives, the search engine, downloads and
contributions, is fully working again. It's on a new server with
upgraded hardware, so access should be faster now as well (if it
ever was slow before ;-).
The URL is the same as before:
http://www.gnu-pascal.de/
Frank
--
Frank Heckenbach, frank(a)g-n-u.de, http://fjf.gnu.de/, 7977168E
GPC To-Do list, latest features, fixed bugs:
http://www.gnu-pascal.de/todo.html
GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8
I have uploaded a new alpha version of GPC to
<http://www.gnu-pascal.de/alpha/>.
This is an ALPHA version. Not so many extensive tests have been made
and the test suite is not expected to pass without errors. I'm not
uploading binaries, diffs, separate test suite archives, updated web
pages etc., just the source distribution. (Of course, others may
feel free to upload binaries for various platforms.) I'm not aware
of any serious bugs, but you have to decide for yourself whether to
use it for production work.
New features:
* new options `--[no]-nonlocal-exit' (default in `--ucsd-pascal' and
`--mac-pascal') (fjf988[fijk].pas, fjf1062*.pas) (U) (M)
* new options `--[no]-object-checking' (on by default) to check on
virtual method calls if VMT pointer is not nil and has matching
`Size' and `NegatedSize' entries, new options
`--[no]-range-and-object-checking' which are now equivalent to
`$R[+-]' (fjf1053*.pas) (B)
* new options `--[no]-pointer-checking',
`--[no]-pointer-checking-user-defined'; new variable
`ValidatePointerPtr' (fjf1052*.pas, pcerrorc.pas) (these options
are _off_ by default!)
* new options `--[no]-implicit-result' (fjf1022*.pas) (on by default
*only* in `--delphi' mode!) (D) (@)
* new options `--{en,dis}able-predefined-identifier' (fjf1037*.pas)
- Bug fixes:
* check initializers of unused types (fjf898*.pas)
* check identifier scopes stricter (az25.pas, fjf1059*.pas)
* in `--borland-pascal' give only a warning, not an error,
for duplicate `case' elements (drf6*.pas)
* multi-dimensional `packed' arrays are not correctly packed
(fjf149*.pas)
* check arithmetical overflow in constants somewhat better
(fjf206*.pas)
* check duplicate external declarations stricter (fjf948.pas)
* check that actual discriminants match in parameters and
assignments, and in strict EP mode, check that actual
discriminants of parameters within one identifier list match
(berend4.pas, fjf104[45]*.pas, typeof[2-4].pas)
* check pointer to schema types stricter (fjf130.pas, fjf614.pas,
schema3a.pas affected)
* allow importing the same value as a result of distinct
expressions under the same name for EP modules for ordinal,
pointer, string and set constants (fjf1040*.pas, stef1.pas)
* allow attributes for procedural types (chief56.pas)
* problem with string operations and `goto' (contour0.pas,
contourbug.pas, martin1.pas, berend3.pas)
* check `goto' targets more strictly
<261020020000077022%gpaeper(a)empirenet.com>,
<Pine.LNX.4.44.0210281004000.31943-100000(a)duch.mimuw.edu.pl>
(az48.pas, fjf701*.pas, fjf1038*.pas, gale6.pas)
* `Result' is not completely Delphi compatible (fjf1022*.pas)
* problem if a `Write' or `WriteLn' argument calls a
routine which writes to the same file (fjf1036.pas)
* `Update' as well as writing after reading or checking
`EOF' can get the file position wrong in some cases (arp2*.pas,
fjf159.pas, fjf160*.pas)
Frank
--
Frank Heckenbach, frank(a)g-n-u.de, http://fjf.gnu.de/, 7977168E
GPC To-Do list, latest features, fixed bugs:
http://www.gnu-pascal.de/todo.html
GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8
I have uploaded a new alpha version of GPC to
<http://www.gnu-pascal.de/alpha/>.
Important notes:
- This is an ALPHA version, as discussed on the mailing list before.
Not so many extensive tests have been made (though the test suite
passes on my system). I'm not uploading binaries, diffs, separate
test suite archives, updated web pages etc., just the source
distribution. (Of course, others may feel free to upload binaries
for various platforms.) I'm not aware of any serious bugs, but you
have to decide for yourself whether to use it for production work.
- Bison (building GPC)
Bison version 2.0 has been released. It can be obtained at
<ftp://ftp.gnu.org/gnu/bison/bison-2.0.tar.gz>. This is now the
recommended version for all GPC compilations. Fortunately, we now
don't depend on changing alpha/beta versions of bison anymore.
Bison is required when building a minimal distribution of GPC
(which now doesn't include the Bison generated files anymore, as
it did temporarily); when building a full source distribution and
not modifying the bison input files (*.y), bison is not strictly
needed, but in case of doubt, it can't hurt to install the new
bison version.
New features:
- Support for gcc-3.4.x (tested with 3.4.3)
The caveats that apply to gcc-3.3.x (especially on Dos/Windows)
also apply here.
- Renamed options
Due to the way that gcc-3.4.x handles options, we had to rename
two options (command line and compiler directive, respectively).
To avoid confusion, we did this for all backend versions:
--no-default-paths -> --disable-default-paths
--no-debug-info -> --disable-debug-info
Note: `--disable-debug-info' is only used in very special cases,
and usually as a compiler directive. To turn off debug info one
would normally use `-g0' which remains unaffected.
- Qualified identifiers
(chief18.pas, fjf260*.pas, fjf921*.pas, grp1.pas, kurzw1.pas,
mod{9,10,13..17}*.pas)
GPC now supports qualified identifiers, both Extended Pascal and
Borland Pascal style.
A small incompatibility to previous versions arises when a
declaration has the same name as an interface, which is not EP
conformant, but GPC previously allowed. This will now cause
compile-time errors. The solution is to rename either the
interface or the declaration.
The linker names, if not specified explicitly, are now completely
different. Since those linker names should not be relied upon
anyway, we hope this is no problem. If you get problems here, just
add `name' attributes where necesssary. (This will also make the
code more robust, in case the internal conventions ever change
again.)
- Importing within a routine (EP feature) works now.
(mod15[c-e].pas)
- Range checking
(chuck5.pas, fjf446.pas, fjf989*.pas, fjf992*.pas, fsc{01..37}*.pas,
miklos1[bc].pas, mir{016,021..028,030..047}*.pas, russ4*.pas)
GPC now supports full range checking (previously it did so only
for dynamic ranges and sets). Range checking is on by default (in
all dialects) and can be turned off and on again by command-line
arguments or compiler directives (`{$[no-]range-checking}' and
also `{$R-}' and `{$R+}', BP compatible).
Note, this is not overflow checking, which may be implemented
later and will be a separate option, just like in BP. Range
checking applies when a value of a larger type (e.g., an `Integer'
variable or the result of an integer operation) is used in a place
where a subrange is expected (e.g., an array index, or assignment
to a variable with more limited range). Overflow checking would
apply if the result of an arithmetic or other operation exceeds
the representable values (e.g., `var a: Integer = MaxInt; [...]
WriteLn (a + a)'). This is not yet checked.
For input operations (`Read', `ReadLn', `ReadStr', `Val'), range
checking errors are treated as I/O errors, so they can be trapped
with `{$I-}' via `IOResult' (for `Read*'), or for `Val' via the
3rd parameter (while range errors in the 3rd parameter of `Val'
itself are treated as regular runtime errors; this paramter is the
error position, so range errors there can be avoided simply by
declaring it of a sufficiently larger type, usually just `Integer'
or `Cardinal').
For strings, range checking is BP compatible (access up to the
capacity allowed) in `--borland-pascal' and `--delphi' modes and
EP compatible (access only up to the current length allowed)
otherwise. So in default (EP) mode code such as
if MyString[1] = '-' ...
without a check
if (MyString <> '') and ...
may now fail with a range-checking error. This is useful, since
the first test was always undefined if `MyString' was empty, but
in my experience so far, this has been one of the most common
causes of range-checking errors in my code.
The same applies with `var' parameters and the address operator as
well, so e.g. code such as:
BlockRead (f, StringLength, SizeOf (StringLength));
BlockRead (f, s[1], StringLength);
SetLength (s, StringLength);
needs two changes to be range safe now:
BlockRead (f, StringLength, SizeOf (StringLength));
SetLength (s, StringLength);
if StringLength > 0 then BlockRead (f, s[1], StringLength);
Another example (rather low-level code, found e.g. in the RTS):
BufPtr := PChars0 (@s[1]);
BufSize := Length (s);
will fail if `s' is empty. Possible change (provided the using
code doesn't access `BufPtr' if `BufSize' is empty, which would be
undefined anyway when reading):
if s = '' then
BufPtr := nil
else
BufPtr := PChars0 (@s[1]);
BufSize := Length (s);
- `pow', `Trim', `Card', set operations (`-', `*', `><'), set
comparisons, string comparisons and array slices with constant
arguments can now be used in constants (fjf998*.pas, fjf1000*.pas,
fjf1009*.pas)
- Initialized types in record and object fields and in schemata work
now. (inirec[24].pas, fjf1016*.pas)
- Types and initializers containing variable expressions, including
schemata with non-constant discriminants work now.
(couper[45].pas, fjf186.pas, fjf548.pas, fjf612a.pas, fjf997*.pas,
fjf1003*.pas, john1a.pas)
- With `-Wnested-comments' and without `--nested-comments' warn
about comment openers found within comments. (fjf1017*.pas)
- New options `--[no-]case-value-checking' (fjf1012*.pas)
- Arithmetics with a complex and a real operand
are now better optimized.
(<20020118143553.B28837(a)artax.karlin.mff.cuni.cz>)
- Bug fixes:
* warn if an lhs cast decreases alignment (avo9.pas)
* don't require result variables in forward declarations except in
strict ISO mode (marku10*.pas)
* writing to a file buffer at EOF didn't work (eof1.pas)
* don't allow `f^' for unopened files `f' (pcerror[ij].pas)
* evaluate initializers exactly as often as specified
(fjf1019.pas)
* in standard Pascal modes, `EOF' is false on an empty file
(tom7.pas)
* wrong `arithmetical overflow' with `set of byte' (igor1.pas)
* `ParamStr' evaluated its argument twice (fjf963b.pas)
* user-defined operators must not be applied to implicit
operations (fjf991.pas and many other cases)
Frank
--
Frank Heckenbach, frank(a)g-n-u.de, http://fjf.gnu.de/, 7977168E
GPC To-Do list, latest features, fixed bugs:
http://www.gnu-pascal.de/todo.html
GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8
I have uploaded a new beta version of GPC to
<http://www.gnu-pascal.de>!
The main changes are fixes for 64 bit platforms that were partly
broken with 20041017 (some tests still fail on these platforms, but
these are mostly problems with the tests themselves), and slightly
improved compatibility to Mac Pascal dialects.
In detail, new features:
- `Exit' with an argument (non-local exits not yet supported)
(fjf988*.pas) (U)
- new options `--[no-]propagate-units' (on by default with
`--mac-pascal', off in other dialects) (fjf987*.pas) (M)
- enable `Pointer' in `--mac-pascal' mode (Mac Pascal has a
`Pointer' function which does the same as a type-cast to
`Pointer'; though adding `Pointer' as a type allows more, it's
backward-compatible) (M)
- `&' and `|' (shortcut `and' and `or') (fjf981*.pas) (M)
- `Leave' and `Cycle' (equivalent to `Break' and `Continue')
(avo3.pas) (M)
- optimize `WriteLn (... string_constant') and
`Write (... string_constant, string_constant ...)'
- `BindingType' is now a packed record as EP demands (fjf975a.pas) (E)
Fixed bugs:
- accessing components of a constant (EP) constructor (indexed by a
constant for arrays) must yield a constant again (dave3*.pas)
- GPC crashes when using two variables with identically-named fields
in a single `with' statement (withbug.pas)
- GPC doesn't accept `case' statements without case-list-elements
(fjf982*.pas)
- gcc-3.x: options are wrongly reordered (so, e.g., `--gnu-pascal
-Wno-underscore' doesn't work as expected) (avo7.pas)
- applying `not' to a function result in parentheses doesn't work
(avo6.pas)
- packed array indices containing `mod' don't work (avo4.pas)
- GPC sometimes prints `???' instead of the actual file name in messages
- function results (of record type) must not be allowed as `with'
elements (only a warning in `--delphi' and `--mac-pascal' modes
for compatibility); fields of non-lvalue `with' elements must not
be lvalues either (fjf493*.pas)
- value parameters of type `String' (undiscriminated) must take the
capacity of the actual parameter, according to EP (waldek11*.pas)
- initialized types in arrays (fjf233.pas, fjf974*.pas)
- initializers are ignored in `New' and `Initialize' (fjf967[j-l].pas)
- the address of global routines is not allowed in initializers (avo2*.pas)
Frank
--
Frank Heckenbach, frank(a)g-n-u.de, http://fjf.gnu.de/, 7977168E
GPC To-Do list, latest features, fixed bugs:
http://www.gnu-pascal.de/todo.html
NEW! GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8
Hi everybody,
I am happy to announce that the GPC web site
<http://www.gnu-pascal.de> is back online, after several weeks of
problems on the server.
The current GPC beta release (20041017) is on the download page.
Previous alphas/betas between 2.1 and this one have been omitted
since I'd have to reconstruct them from my archives and verify them
to be trushworthy, and I don't think it's worth the effort. If there
are serious problems with 20041017, I'd rather fix them, so everyone
can ugprade.
Thanks to Eike Lange and Benedikt Wildenhain for helping set up the
server again and to G-N-U GmbH for hosting the current GPC beta
release in the meantime.
Frank
--
Frank Heckenbach, frank(a)g-n-u.de
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)
I have uploaded a new beta version of GPC to
<http://www.g-n-u.de/gpc/>!
Because our main server is still out of order, please note:
- The new URL, as stated above. www.gnu-pascal.de still doesn't
work.
- There are just the "bare bones" files (full and minimal source
distribution, binaries for Linux/IA32 with and without gcc). No
diffs, no separate test files, no HTML pages etc.
- The main directory in the full source distribution is probably
different! Be careful with automatic build scripts.
- The releases are signed with a new OpenPGP key. The fingerprint is
given in my signature in this mail and my other mails to the
gpc(a)gnu.de list for some weeks.
When the main server is back again, I'll do the usual release
procedures there.
One major change is that the types `Integer', `Word', `Cardinal' are
now equivalent to `PtrInt', `PtrWord', `PtrCard', no more
(necessarily) to C's `int' and `unsigned int' types. New types
`CInteger', `CWord', `CCardinal' are provided for the latter
purpose.
This affects C interfaces in particular. A "porting guide" is given
below. If you maintain any such interfaces, be sure to read it
carefully.
Another major improvement is in the area of initializers, thanks to
Waldek Hebisch. GPC now allows initialization of variant records
(fjf259.pas, peter6.pas) and packed arrays (emil5.pas) and supports
Extended Pascal's structured initializers (fjf964*.pas, fjf967*.pas,
fjf968*.pas) as well as record, array and set values (constdef.pas,
fjf966*.pas, fjf971*.pas).
Unfortunately, we don't have very many test programs for these new
features yet. If you can send us some (according to the guidelines
described in the manual), this will be very welcome.
Other new features:
* `Discard'
* new make variable `GPC_PAGESIZE' to set the page size when
building the manual (PDF, PostScript, DVI)
* `qualified' and import lists are no more allowed after `uses'
(only after `import', as EP demands) (@)
* the `GMP' unit doesn't support gmp-2.x anymore (if you used it,
just upgrade to a newer GMP version) (@)
* conflicts between object fields/methods and ancestor type names
are detected as required by OOE (fjf945*.pas) (@) (O)
* repeated function headings (in `forward' declarations and
interfaces) are checked stricter: if one has a result variable, so
must the other (according to the OOE draft) (@) (O)
Bugfixes:
* records with no fields are invalid according to EP (fjf972.pas)
* `Index' and `Pos' cannot be used in constant expressions
(fjf970*.pas)
* the `__FILE__' and `__BASE_FILE__' macros should return full paths
* `Sqr' sometimes evaluates its argument twice (fjf963.pas)
* memory leak in routines with a local variable of file type that
are left via `Exit' or `Return' (fjf962.pas)
* using a Boolean function as a condition in a `repeat' loop doesn't
work correctly (artur1*.pas)
* overstrict type-checking in comparisons involving procedural types
(fjf960*.pas)
* `Read', `Write' etc. evaluate its arguments in the wrong order
(az43*.pas)
* `Read' etc. evaluate references to string parameters twice
(fjf958.pas)
* on targets with 16 bit `Integer' type, the `MicroSecond' field of
`TimeStamp' causes a compilation error
* character arrays indexed by non-integer ordinal types treated as
strings cause internal compiler errors (fjf957*.pas)
* `-W[no-]cast-align' does not work (fjf956*.pas)
* in `FormatTime' `%Z' and `%z' unless provided by system library
ignore DST
* powerpc: `--strength-reduce' doesn't work with `for' loops (was
kludged before, fixed in gcc-3.3.3)
* AIX: `ReturnAddress' doesn't work after use of dynmamic variables
(backend bug, fixed in gcc-3.3.3)
* functions returning sets are called twice if range-checking is on
(inga1*.pas)
PORTING GUIDE FOR THE NEW C COMPATIBLE INTEGER TYPES
====================================================
In my experience, the transition goes as follows:
1. If you want your code to keep working with older GPC versions
after this change, add (near the top) the following part. You can
omit the types you will not need in the following.
{$if __GPC_RELEASE__ < 20041017}
type
CInteger = Integer;
CCardinal = Cardinal;
CWord = Word;
{$endif}
2. In all C-visible declarations, replace `Integer' with `CInteger'
and `Cardinal'/`Word' with `CCardinal'/`CWord'.
C-visible declarations are usually `external' declarations
(routines and/or variables) in Pascal which are implemented in C,
but they can also be Pascal-implemented declarations (usually
with a `name' attribute) which are declared `extern' in C code.
Do not forget structures that are used within such declarations,
e.g. parameters of type [pointer to] a record, or procedural
parameters, etc.
The same goes for other languages such as C++.
3. Fix any resulting incompatibilites. (This is the nasty part.)
Value parameters are usually no problem.
Anything else might be a problem, e.g., reference parameters,
variables, structure fields, procedural parameters' parameters
(including value parameters). As long as they are used only in
the implementation of a unit/module which exports a Pascal
interface, necessary changes can be confined to and handled
within this interfaec.
Otherwise, you have the choice whether to change the interface,
which will require further changes in code using the interface,
or to add wrappers to keep the interface.
Example:
unit MyCInterface;
interface
uses GPC;
type
t = record
x, y, z: Integer
end;
procedure a (n: Integer); external name 'a';
procedure b (var n: Integer); external name 'b';
procedure c (var r: t); external name 'c';
function d (var n: Integer): TString;
implementation
function cd (var n: Integer): CString; external name 'd';
function d (var n: Integer): TString;
begin
d := CString2String (cd (n))
end;
end.
Changing a to
procedure a (n: CInteger); external name 'a';
is usually harmless.
Changing b to
procedure b (var n: CInteger); external name 'b';
is problematic, since all callers would need to change their types
(which might cause further ramifications in indirectly dependent
code). So it might be in order to add a wrapper, such as:
procedure b (var n: Integer);
[implementation]
procedure cb (var n: CInteger); external name 'b';
procedure b (var n: Integer);
var cn: CInteger;
begin
cn := n; { omit if n is used only as an "output" parameter }
cb (n);
n := cn
end;
Procedure c uses a record containing `Integer' fields. Here, it's a
hard choice between adding a wrapper (might be expensive, as the
record gets bigger, and if more routines are affected) or changing
the record to:
type
t = record
x, y, z: CInteger
end;
The choice might depend on how many other routines use this
structure and how many of them are written in Pascal or C, and how
much existing code already uses the structure and what it does with
it.
Function d already has a wrapper, so it's usually best to also take
care of the new change there:
function d (var n: Integer): TString;
var cn: CInteger;
begin
cn := n; { omit if n is used only as an "output" parameter }
d := CString2String (cd (n))
n := cn
end;
Finally, note that `Integer' might be bigger than `CInteger',
especially on newer platforms (that's the reason for the whole
change in the first place). So if you want to have a bigger range
available, you might want to consider changing from `CInteger' etc.
(`[unsigned] int' in C) to `MedInt' etc. (`[unsigned] long' in C).
This, however, requires (possibly substantial) changes in the C
code, and might be out of your control (when interfacing to 3rd
party libraries).
Frank
--
Frank Heckenbach, frank(a)g-n-u.de, http://fjf.gnu.de/, 7977168E
GPC To-Do list, latest features, fixed bugs:
http://www.gnu-pascal.de/todo.html
NEW! GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8
Hi Folks,
the GNU Application Libraries for Pascal (GNUALP) framework has grown. After
multithreading, it now also provides database access. As a default
implementation, there is an ODBC unit available.
The tarballs can be downloaded from http://www.markus.gerwinski.de/gnualp/. To
run the ODBC part, you will have to install gnualp-0.1.5.tar.gz first, then
gnualpodbc-0.1.1.tar.gz. Both projects can be installed, as usual, with
./configure, make, make install.
To run the demo program(s) in the demos/pas resp. demos/c subdirs of
gnualpodbc, you'll need to have a working ODBC environment installed. If you
have, just start the odbcdemo program with a valid data source name as command
line argument, and you'll see a nice little command-line SQL client. :-)
gnualpodbc-0.1.1 is tested with the following system configurations:
- SuSE Linux 8.0 and above, iodbc-3.51.2, and a mysql-4.0.20 database
accessed via myodbc-3.51.09.
- Windows XP with MinGW, mysql-4.0.20, and myodbc-3.51.9-win. You'll maybe
have to download libmsvcp60 from somewhere (it was pre-installed in my
MinGW distro, but that doesn't seem to be standard).
Have fun,
Markus
Markus Gerwinski proudly presents:
GNU Application Libraries for Pascal, in short GNUALP, pre-release 0.1.4.
The current status of the package contains units for
- exception handling,
- standard collection types (lists, hashtables etc.),
- system time and calendar functions,
- and last but not least: multithreading.
You can download a tarball with the current sources from
http://www.markus.gerwinski.de/gnualp/gnualp-0.1.4.tar.gz.
The library is tested on SuSE Linux 8.0, 9.1, and Windows XP with MinGW.
You can install the tarball just the usual way, i.e. unpack it into your source
directory, then run "./configure", "make", "make install", and everything will
be in place. The API units will then be installed to a directory named
/usr/local/units/gnualp-0.1. This also generates a shared library,
libgnualp.so, which you'll have to link against. E.g. to compile a program
foo.pas which uses the GNUALP library units, your gpc compiler call will have
to look like this:
gpc --automake --unit-path=/usr/local/units/gnualp-0.1 foo.pas -o foo -lgnualp
This library is work under development and far from being complete, so it is
all undocumented up to now. However, since several folks seemed to have a
pressing urge for multithreading, I'll give a short introduction here on how to
use the resp. features of the library:
- Include `AlpThreads' into the uses clause of your program. Declare any threads
you want to start as vars of type `pThread'.
- To run some simple procedure as a thread, give it a parameter list like this:
Procedure doingSomething ( thread: pThread; data: pointer );
You can then from anywhere in the program create a thread object for this
procedure with the following statement:
someThread:= new ( pSimpleThread, start ( doingSomething, nil ) );
The thread then starts running immediately and will automatically dispose
itself after it is ready. It can be stopped from within the doingSomething
procedure using the command `thread^.stop'. In this case, it will also
dispose itself.
For more sophisticated thread handling, derive an object type from the
abstract tThread type and override the `work' method to do whatever the
thread is supposed to do; if need be, you can also override the `cleanup'
method. This one's always executed at the end of the thread, no matter if it
was regularly ended or `stop'ped in-between.
- Mutexes and semaphores are represented by the tMutex and tSemaphore object
types. To create e.g. a mutex, just call
mutex:= new ( pMutex, init );
To lock the mutex, call `mutex^.lock'; to unlock it, call `mutex^.unlock'.
To dispose it after use, call `dispose ( mutex, fini )'. Just as simple. :-)
Semaphores work in an analogous way; they only require an integer parameter
in their constructor to determine the maximum count of threads they may be
accessed by.
For usage examples, see the files simplethreads.pas, mutexes.pas, and
semaphores.pas in the demos/pas subdirectory of the gnualp package. They aren't
documented or commented either, since I've only set them up as a test for
myself, but I hope the code isn't too difficult to read. :-}
Regards,
Markus
I have uploaded the first public beta version of GP to
<http://gnu-pascal.de/contrib/frank/misc/gp-0.54.tar.gz>.
GP is a utility to automate the building of Pascal programs using
the GPC compiler. It is the intended replacement for GNU Pascal's
problematic automake feature.
If you have been using automake, please try building with GP
instead. When GP works sufficiently, it will be included with GPC in
one of the next releases, and automake support will later be dropped
from GPC.
If you only ever used GPC without automake (e.g., using self-written
Makefiles or otherwise manually) and do not plan otherwise, you
probably do not need GP.
Please read the included files REAMD and INSTALL, as usual.
The GP Manual is contained in `gp.info' which you can read with any
info reader. You can also make a printable documentation with `make
dvi' if you have texi2dvi installed or `make pdf' using texi2pdf.
Quick start:
* Use `gp' instead of `gpc --automake --executable-file-name'. Most
other GPC options can be used the same way with GP.
* If the source file given on the command line is a unit or module,
GP recognizes this automatically and does not try to link it, so
you don't have to give the option `-c'.
* If your compilers are not called `gpc' and `gcc' you can set `PC'
and `CC' wither on the command line or as environment variables.
This is mostly the same you would do when using `make'.
* Note the new `.gpd' files, e.g. if you want to clean a build
directory. (But you might want to consider using `gp --clean' or
`gp --clean-objects' for this purpose.)
The main features of GP are:
* Automatically finds all dependencies, units used and include files
as well as C, assembler and object files and libraries referenced
in `{$L}' and `{$R}' directives.
* Recompiles everything when necessary (no need to give
`--automake').
* Avoids unnecessary recompilations if only the implementation of a
unit used has changed since the last compilation, by comparing a
MD5 value of the interfaces of units. Recompilation is even
avoided if only comments in the interface have changed, but not
when they influence line numbers - since the GNU tools store line
number information in object and other files, this does constitute
a small difference.
* Supports `--autobuild' to recompile everything.
* Does not use GPC's buggy automake feature, so it should work also
on systems where automake doesn't. Also, in many cases, it will
use less total memory than GPC's automake because it calls the
compiler iteratively rather than recursively.
* Recognizes and supports transparently cyclic unit dependencies
(where, naturally, at least one dependency in each cycle must be in
the implementation rather than the interface).
* Uses the base name of the main program's file name as the
executable name by default, rather than `a.out' (no need to give
`--executable-file-name' or `-o foo', but these options are also
supported). In the strange case that you want your output file to
be called `a.out', you can use `-o a.out'.
* Does not try to link a unit given on the command line (no need to
give `-c' for units, but `-c' is also supported in case you want
to compile, but not link, a program).
* Tries appending a `.pas', `.p', `.pp' or `.dpr' suffix (in this
order) to the file name given on the command line when necessary,
i.e. you can invoke it as `gp foo.pas' or just `gp foo'.
* Calls `gcc' rather than `cc1' (which GPC would call) to compile C
files, so it also works if the versions of the installed GCC
compiler and the backend the installed GPC is based on don't match.
* Supports GPC's path options (`--unit-path', `--object-path',
`--unit-destination-path', `--object-destination-path',
`--executable-path') transparently, also for units given on the
command line (where GPC ignores `--unit-destination-path').
* Supports `--include-path' and `--library-path' which work the same
way as `-I' and `-L', respectively, but can be given multiple
directories at once.
* Uses all unit and object paths as include paths automatically, to
simplify using units or C files with includes in other directories.
* Stores the compiler version, target platform and options given
(together with other dependency information) in files with suffix
`.gpd' ("GNU Pascal Dependencies") and recompiles files when the
compiler version, platform or options differ from those they were
compiled with.
* Compiles the main program to an object file before linking, so it
does not have to be recompiled when only a unit's implementation
changes, and you have it available in case you want to link it
explicitly.
* The options `--progress-messages' and `--progress-bar' are
extended to give information on the progress of the compilation of
the whole project (not only of a single source file as when
calling `gpc' directly).
Some limitations:
* The handling of default options and simpler usage of dialect
options (as discussed on the mailing list) is not yet included.
This will be added in a later revision. However, this does not
have any influence on the main functionality of building Pascal
programs (you just have to give your options explicitly, as you do
when calling `gpc').
* Extended Pascal module support is experimental.
* More than one unit/module/program in one source file is not
supported.
* Modules with interface and implementation parts in separate source
files are not supported. This seems to be difficult to do at all,
since the information where to find the implementation module is
simply missing from the source. If you have any good ideas on this
topic, please send them to the GPC list.
* Other more or less strange things may not be supported. If you
find anything, let me know, so I can decide whether to support it
or to document that it's not supported.
GP is Copyright (C) 2000-2004 Free Software Foundation, Inc. It was
written by Frank Heckenbach <frank(a)pascal.gnu.de>. It is distributed
under the terms of the GNU General Public License, version 2.
Frank
--
Frank Heckenbach, frank(a)g-n-u.de, http://fjf.gnu.de/, 7977168E
GPC To-Do list, latest features, fixed bugs:
http://www.gnu-pascal.de/todo.html
GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707