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
Peter:
together with binaries for DOS (DJGPP), and Linux (ELF). Binaries for DOS and OS/2 (EMX) and FreeBSD will follow as soon as possible.
There seems to be a problem with the new DJGPP version (I downloaded the zip file gpc-971001.i386-djgppv201.zip from /beta/binary subdirectory).
With the 971001 version, I still get the "incompatible pointer type" that was supposed to be fixed (minor problem, of course), and (much worse) the linker now complains about undefined references to certain library functions -- in my case the exp() and ln() functions.
There is another strange (very) problem with the DJGPP archive:
I get wrong timestamps for certain files when unzipping the DJGPP archive with InfoZip's UnZip version 5.31 (the most recent version). The files are OK, though (no corruption). The problem does occur with version 5.12, or with PKunzip. Moreover, the timestamp problem only affects certain files in the DJGPP archive, basically those in the /bin, /lib and /info subdirs. All files dated (timestamped) prior to 19-FEB-1997 are OK!
This problem (whether it is with unzip 5.31, or zip archive itself) also occurs with the 970714 beta version (again, DJGPP).
I don't think its a bug in InfoZip (?) because I haven't observed the problem with other zip archives.
Jesper Lund jel@hha.dk
Peter Gerwinski wrote:
A new beta version of GNU Pascal is being uploaded to Agnes: gpc-971001.
I have dowloaded the binary version for DJGPP v2.01 and the corrected libgpc.a and found some bugs:
Working in plain DOS with command.com or with the bash shell (bsh1147b) or in a windows 3.11 DOS box:
- The test\borland_\iso.pas is completely broken
- The test\extended\time.pas works OK with the bash shell, but is broken with ordinary command.com DOS shell (or Win3.11 DOS box): I receive a system message in french: Heure non valide Entrez la nouvelle heure: as if I had try to set the time with a wrong value (ie 26:00) instead of getting it as the program intends to, and the program is aborted without further warning (I get none of the messages which are in the program)
- more important: when trying to compile the unit System.pas contained in BPcompat 1.0 I get a SIGSEGV error, code 004 during the compilation of __init_system (I use the -Q switch). this occurs in plain DOS with command.com or bash shell, but not in a Windows DOS Box, where the compilation is OK. This points to a problem with the DPMI server which is the main difference between the two cases. I use CWSDPMI (3b), loading a fresh copy changes nothing. Looking to the DJGPP FAQ (par. 9.1) they say that such a difference between plain DOS and Windows behavior may come from the fact that cwsdpmi (and DJGPP v2) does not initialise memory on loading, while Windows does it, giving the possibility of an erratic bug for uninitialized pointer or variable. Anyhow the bug is in the compiler not in the unit. Any idea ?
Maurice Lombardi wrote:
Peter Gerwinski wrote:
A new beta version of GNU Pascal is being uploaded to Agnes: gpc-971001.
- The test\borland_\iso.pas is completely broken
Oops. Sorry it works with --fextended-pascal and --fobject-pascal, I had not understood the purpose of the test !
I have tried to build gpc-971001 from the zip sources for DJGPP v2.01 I use plain DOS with or without bash shell:
-unzip fresh new gcc-2721 in directory %DJDIR%\gnu\ -unzip gpc sources to %DJDIR%, then put the p\ tree as subdirectory of gcc-2721
then follow instructions contained in p\config\msdos\readme2.dj.
It builds gcc, but then stops without building gpc ?
Other problems found:
1- the p\config\msdos\configur.bat must be in dos format (return-linefeed) to run in plain dos (the configur.bat in gcc is correct). Under bash shell, it runs but complains about insufficient environment space (presumably to set LANG= c++.& pascal.&), probably a problem with my implementation of bash, so I run in plain dos after translating unix to dos.
2- there is a problem with backward slashes \ in the makefile in lines like ./bi-arity < $(srcdir)\bytecode.def >tmp-bc-arity.h (three times). Seems to come from the application of gnu\gcc-2721\config\msdos\top.sed and is already present in the compilation of gcc alone. I have filed a bug report to dj delorie, and fixed it manually after running configure go32 which produces this makefile.
3- there is a .gdbinit file in the source which causes problem because this is an illegal dos name. pkunzip just discards it, InfoZip extracts it as _.gdb, which is certainly not correct. The correct is _gdbinit as is in gcc-2721s.zip file. This is the behavior obtained by untarring with djtar, and is what is supposed by the bash shell (which replaces e.g. .login by _login etc). I have fixed it by extracting with infozip and renaming _.gdb to _gdbinit.
But no change: stops after building gcc. Instructions coming from gpc are contained at the end of the makefile after running configure go32, but they have no effect. Any idea ?