Hello everybody!
A new beta version of GNU Pascal is being uploaded to Agnes: gpc-971001. This is merely a bug fixing release, but there are some now features, too - most of them intended to achieve better compatibility to other compilers.
The GNU Pascal development team welcomes two new members: Bill Currie implemented some new built-in functions, and Frank Heckenbach improved the run-time system to deal with non-standard situations.
Bug fixes and new compatibility features ========================================
GPI mechanism:
* The installation problem caused by a variable `_end' is gone.
* Function attributes and schemata containing expressions now survive transport through a GPI file.
* Open files now survive transport through a GPI file. Now you can write BP's `Printer' unit in the canonical way.
* Some crashes observed with GPI files on Windows 95 should not occur any more.
* Pointers should no more lose compatibility to themselves when imported from more than one GPI file. (E.g. when importing objects with the same parent type from different units, you don't get a superfluous warning any more.
* Some errors that only occured when a virtual method having an undiscriminated string parameter was transported through a GPI file have vanished.
* The temporary `.gpc' file should now be deleted after compilation in all cases.
Procedural parameters, variables, and pointers:
* Problems with procedures and functions that were called when they should be passed as a parameter or taken the address - or vice versa - should have disappeared now.
* Procedures and functions declared in the main program now can be safely assigned to a procedural variable or pointer.
* GPC now checks for the erronous assignment of a procedure to a pointer to a procedure. Assign the address instead.
* When `foo' is a procedural variable (= reference to a procedure), `@foo' yields a pointer to the procedure, and `@@foo' the address of the procedural variable itself (like in Borland Pascal).
Range checking:
* In most situations where constant value are involved (assingment of a constant expression to a variable, initialization, ...) GPC now performes range checking. This holds for ordinal values and strings.
* Arithmetics with integer constants should no more overflow if intermediate results do not fit in `Integer'. The result is then range-checked.
Standard Pascal:
* GPC now passes (again) all level 0 PVS conformance tests. Some things are still broken with high optimization levels on the DEC Alpha. For gpc-2.1, we plan to have them fixed and to have level 1 passed as well.
* Non-local `goto' targetting the main program works again. (It was broken in some unofficial intermediate releases due to some other improvements.)
* Using global variables as `for'-loop control variables in the main program works again. (This was also broken in some unofficial intermediate releases due to some other improvements.)
* Comments starting with `{' and ending with '*)' or vice versa still work. (They were also broken ... see above.)
* The function `arctan' works again. (It was ... well, you know.)
* The transfer procedures `pack' and `unpacked' work again. (They were broken (for obvious reasons) when packed arrays were introduced.)
* Non-trivial expressions involving components of packed arrays work now.
* Type checking of sets has been improved.
* Set expressions ("set constructors") should work in all cases now.
* Comparisons of sets of different size (including the empty set) work now.
* Subranges are now compatible to their parent type.
* Comparisions between char constants are no more warned about in `--standard-pascal' mode.
* Parameters of `read' now may be components of packed arrays and records as long as they are aligned on a byte boundary.
* Missing program parameters are warned about in `--standard-pascal' mode. This warning does *no more* turn into an error with `--pedantic-errors' because it is valid in ISO Pascal (while useless) to write a program without any input and output.
* Tag fields of variant records now can be initialized in `New':
Type FooPtr = ^FooRec; FooRec = record case Bar: Boolean of true: ( a: Integer ); false: ( b: Char ); end (* FooRec *);
Var p: FooPtr;
New ( p, true ); (* Assigns `p^.Bar:= true' *)
Extended Pascal:
* Undiscriminated strings and schemata passed as function parameters should now work in all cases.
* In a schema type declaration, the discriminants now may be part of expressions.
Borland Pascal:
* GPC now has a built-in `Assign' procedure.
* In units and with `external' and `forward' procedures and functions, GPC now checks that the parameter lists match (if the second one exists).
* Some bugs with `#$42' char constants (when they appeared in sequence or at the beginning of a line) are fixed now.
* GPC now allows to put a variable to specified address with `absolute': "Var foo: Integer absolute 42;". This is only useful on systems without virtual memory - *not* with DOS (DJGPP or EMX). Outside $X+ mode, you get a warning about this use of `absolute'. (Note that GPC uses a flat memory model and thus does *not* define BP's "Var foo: Integer absolute $40:$42;".)
* Assignments between object variables are now complained about.
GNU extensions:
* New built-in types: `MedReal' and `LongestReal'.
* `New' with schema pointers now can be called analogously to `New' with object pointers:
Type MySchema ( n: Integer ) = array [ 1..n ] of Byte; MySchemaPtr = ^MySchema;
Var p: MySchemaPtr;
p:= New ( MySchemaPtr, 42 );
* `__volatile__' variables no more become `__external__' automatically.
* Machine attributes now also work for variables, not only functions.
* Function attributes now can have more than one argument.
* The run-time system (RTS) now can handle most non-standard types such as long integers.
* Fixed strings ([packed] array of Char) with a lower bound different from 1 are now handled correctly.
* `ReadStr' can read from a `CString' (= `PChar') now.
* `CString' variables now can be initialized with constants.
* Now you can initialize a pointer to a string with a constant: "Var p: ^String value @'Hello, world!';".
* Type casts from pointers to integers and between integers of different size and signedness work now.
* Taking the address of something not aligned on a byte boundary is now warned about.
* A new function `GetFile ( Const F: any File ): Pointer' now returns a pointer to the C `FILE' structure inside a Pascal `File' variable.
* Declaring statements are now warned about unless compiling with $X+.
* The expression after `absolute' can be an arbitrary expression now: "Var foo: Integer absolute bar^ [ i ].baz;". You can use this to define shortcuts (like macros in C) - use with care. Outside $X+ mode you get a warning if the expression does not reduce to a constant address.
* `Inline' now works like promised in the documentation, and it is redefinable. (`__Inline__' still works.)
Miscellaneous:
* Console I/O under DJGPP now works correctly with certain control characters.
* Linking `.a' files with the (*$L /usr/lib/libfoo.a *) directive works now.
* Some problems with certain built-in functions (`sqr', `pred', `succ', `min', `max') when applied to integer constants have vanished.
* `--pedantic-errors' now has again the same meaning as in GCC. Use `-Werrors' to turn warnings into errors.
* If `gpc --automake' is invoked to compile other languages than Pascal, it no more crashes.
* The source fo the GNU Pascal compiler itself has been cleaned up significantly. Read and enjoy!
Where to get it ===============
The source is being uploaded to
ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/beta/,
files
gpc-971001.tar.gz and gpc-971001.zip,
together with binaries for DOS (DJGPP), and Linux (ELF). Binaries for DOS and OS/2 (EMX) and FreeBSD will follow as soon as possible.
In order to prepare for the release of gpc-2.1, binaries are moved to a subdirectory `binary' of `beta', and some other things are being set up, so don't be confused if some files aren't located any more where they were on the day before.
Acknowledgement ===============
I have lost overview, but the GNU Pascal development team thanks everybody who helped us by contributing useful code and ideas and reporting bugs. Thanks to all of you!
Please go on finding all bugs in gpc-971001! I may have overlooked some you already reported. (If so, please remind me by e-mail.;-) Once GPC is clean, we can release version 2.1 - and face neat new features (e.g. qualified import and identifiers, classes, interfaces, procedure overloading, ...) for 2.2! :)
Greetings,
The GNU Pascal Development Team