This is gpc.info, produced by makeinfo version 4.0 from gpc.texi.

INFO-DIR-SECTION GNU programming tools
START-INFO-DIR-ENTRY
* GPC: (gpc).                   The GNU Pascal Compiler.
END-INFO-DIR-ENTRY
INFO-DIR-SECTION Individual utilities
START-INFO-DIR-ENTRY
* GPC: (gpc)Invoking GPC.       The GNU Pascal Compiler.
END-INFO-DIR-ENTRY

   This file documents the GNU Pascal Compiler.

   Copyright (C) 1988, 1996-2000 Free Software Foundation, Inc.

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License", "The GNU
Project", "The GNU Manifesto" and "Funding for Free Software" are
included exactly as in the original, and provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License", "The GNU Project", "The GNU Manifesto" and "Funding for Free
Software" and this permission notice, may be included in translations
approved by the Free Software Foundation instead of in the original
English.


File: gpc.info,  Node: Top,  Next: Welcome,  Up: (dir)

GNU Pascal
**********

   This manual documents how to run, install and maintain the GNU Pascal
Compiler (GPC), as well as its new features and incompatibilities, and
how to report bugs.  It corresponds to GPC version 20001101 (GCC
version 2.95.x).

* Menu:

Introduction:

* Welcome::           Welcome to GNU Pascal...
* Highlights::        Some of GPC's most interesting features.
* News::              New Features of GNU Pascal.
* FAQ::               The GNU Pascal Frequently Asked Questions List.

Installation:

* Installation::      How to download, compile and install GNU Pascal.

Using GNU Pascal:

* Borland Pascal::    A QuickStart Guide from Borland Pascal to GNU Pascal.
* Invoking GPC::      Command Line Options supported by GNU Pascal.
* Programming::       The Programmer's Guide to GPC.
* Reference::         The Alphabetical GPC Language Reference.
* Keywords::          Pascal keywords and operators supported by GNU Pascal.
* Support::           Where to get support for GNU Pascal; how to report bugs.

Development:

* To Do::             The GNU Pascal To-Do List.
* Internals::         How to get more information from the GPC source itself.

Appendix:

* Contributors::      Contributors to GNU Pascal.
* Copying::           The GNU General Public License -- Your rights and
                      duties when using GPC.
* GNU::               The GNU Project.

* GPC Index::         Index of concepts and symbol names (incomplete).


File: gpc.info,  Node: Welcome,  Next: Highlights,  Prev: Top,  Up: Top

Welcome to GNU Pascal...
************************

   ...  the free 32/64-bit Pascal compiler of the GNU Compiler
Collection (GNU CC or GCC). It combines a Pascal front-end with the
proven GCC back-end for code generation and optimization.  Other
compilers in the collection currently include compilers for the Ada, C,
C++, Objective C, Chill, FORTRAN, and Java languages. Unlike utilities
such as p2c, this is a true compiler, not just a converter.

   This version of GPC corresponds to GCC version 2.95.x.

   The purpose of the GNU Pascal project is to produce a Pascal
compiler (called GNU Pascal or GPC) which

   * combines the clarity of Pascal with powerful tools suitable for
     real-life programming,

   * supports both the Pascal standard and the Extended Pascal standard
     as defined by ISO, ANSI and IEEE (ISO 7185:1990, ISO/IEC
     10206:1991, ANSI/IEEE 770X3.160-1989),

   * supports other Pascal standards (UCSD Pascal, Borland Pascal,
     Pascal-SC) in so far as this serves the goal of clarity and
     usability,

   * may be distributed under GNU license conditions, and

   * can generate code for and run on any computer for which the GNU C
     compiler can generate code and run on.

   Pascal was originally designed for teaching. GNU Pascal provides a
smooth way to proceed to challenging programming tasks without learning
a completely different language.

   The current release implements Standard Pascal (ISO 7185, level 1),
a large subset of Extended Pascal (ISO 10206, aiming for full
compliance), is highly compatible to Borland Pascal (version 7.0) with
some Delphi extensions, and provides a lot of useful GNU extensions.

   This manual contains

   * an overview of some of GPC's most interesting features, see *Note
     Highlights::,

   * a list of new features since the last release, see *Note News::,

   * the GNU Pascal Frequently Asked Questions List, see *Note FAQ::,

   * installation instructions, see *Note Installation::,

   * a QuickStart Guide for programmers used to the Turbo Pascal/Borland
     Pascal compiler, see *Note Borland Pascal::,

   * a list of command-line options to invoke the compiler, see *Note
     Invoking GPC::,

   * the Programmer's Guide to GPC, describing the Pascal programming
     language in general and GPC specifc aspects, see *Note
     Programming::,

   * the alphabetical GPC language reference, see *Note Reference::,

   * a list of keywords and operators supported by GNU Pascal, see
     *Note Keywords::,

   * information on how to report bugs in GNU Pascal and how to get
     support, see *Note Support::,

   * the list of known bugs and things to do, also listing bugs fixed
     and features implemented recently, see *Note To Do::,

   * some information for those who are interested in how GNU Pascal
     works internally, see *Note Internals::,

   * a list of contributors which tells you who devloped and is
     maintaining GNU Pascal, see *Note Contributors::,

   * the GNU General Public License which informs you about your rights
     and responsibilites when using, modifying and distributing GNU
     Pascal, see *Note Copying::,

   * and other texts about Free Software and the GNU Project intended to
     answer questions like "what is GNU?" you might have in mind now,
     see *Note GNU::.

   If you are familiar with Standard Pascal (ISO 7185) programming, you
can probably just go ahead and try to compile your programs. Also, most
of the ISO Extended Pascal Standard (ISO 10206) is implemented into GNU
Pascal. The Extended Pascal features still missing from GPC are
`qualified' module import, `protected' module export variables, set
types with variable bounds, structured value initializers and
expressions as subrange lower bounds.

   If you are a Borland Pascal programmer, you should probably start
reading the QuickStart guide from BP to GNU Pascal, see *Note Borland
Pascal::. If you are curious about the new features GPC offers, you can
get an idea in the overview of GPC highlights (*note Highlights::), and
read in more detail about them in the Programmer's Guide to GPC (*note
Programming::) and in the alphabetical GPC Language Reference (*note
Reference::).

   And, please, think about how you can contribute to the GNU Pascal
project, too. Please support our work by contributing yours in form of
example programs, bug reports, documentation, or even actual
improvements of the compiler.

   All trademarks used in this manual are properties of their
respective owners.


File: gpc.info,  Node: Highlights,  Next: News,  Prev: Welcome,  Up: Top

Some of GPC's most interesting features.
****************************************

   The GNU Pascal Compiler (GPC) is, as the name says, the Pascal
compiler of the GNU (`gnu.html' on GPC's WWW home page) family. This
means:

   * GPC is a 32/64 bit compiler,

   * does not have limits like the 64 kB or 640 kB limit known from
     certain operating systems - even on those systems -,

   * runs on all operating systems supported by GNU C, including

        - Linux (http://www.linux.org) on Intel, Alpha, and all other
          supported types of hardware,

        - the BSD family: FreeBSD (http://www.freebsd.org), NetBSD
          (http://www.netbsd.org), OpenBSD (http://www.openbsd.org),

        - DOS with 32 bits, using DJGPP (http://www.delorie.com/djgpp/)
          or EMX
          (http://www.leo.org/pub/comp/os/os2/leo/gnu/emx+gcc/index.html),

        - MS-Windows 9x/NT, using CygWin
          (http://sourceware.cygnus.com/cygwin/) or mingw32
          (http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/),

        - OS/2 with EMX
          (http://www.leo.org/pub/comp/os/os2/leo/gnu/emx+gcc/index.html),

        - MIPS-SGI-IRIX,

        - Alpha-DEC-OSF,

        - Sparc-Sun-Solaris,

        - HP/UX
      and more,

   * can act as a native or as a cross compiler between all supported
     systems,

   * produces highly optimized code for all these systems,

   * is Free Software
     (http://home.pages.de/~GNU/philosophy/free-sw.html) (Open-Source
     Software (http://www.opensource.org)) according to the *GNU
     General Public License* (http://www.gnu.org/copyleft/gpl.html)
     (see also GNU (`gnu.html' on GPC's WWW home page) for remarks and
     translations),

   * is compatible to other GNU languages and tools such as GNU C and
     the GNU debugger.

   The compiler supports the following language standards and
quasi-standards:

   * ISO-7185 Standard Pascal (`misc.html#ISO' on GPC's WWW home page),

   * most of ISO-10206 Extended Pascal (`misc.html#ISO' on GPC's WWW
     home page),

   * Borland Pascal 7.0,

   * parts of Pascal-SC (PXSC).

   Some highlights:

   * From Standard Pascal: Many popular Pascal compilers claim to
     extend Standard Pascal but miss these important features.

        - Conformant array parameters - the standardized and
          comfortable way to pass arrays of varying size to procedures
          and functions. [Example (conformantdemo.pas)]

        - Passing local procedures as procedural parameters - with full
          access to all variables of the "parent" procedure. [Example
          (iteratordemo.pas)]

        - Automatic file buffers and standard `Get' and `Put'
          procedures. Read ahead from files without temporary variables.
          [Example (filebuf1demo.pas)] This allows you, for instance, to
          validate numeric input from text files before reading without
          conversion through strings. [Example (filebuf2demo.pas)]

        - True packed records and arrays. Pack 8 Booleans into 1 byte.
          [Example (packdemo.pas)]

        - Internal files. You don't have to worry about creating
          temporary file names and erasing the files later.  [Example
          (intfiledemo.pas)]

        - Global `goto'. (Yes, `goto' has its place when it is not
          restricted to stay in the current routine.)  [Example
          (parserdemo.pas)]

        - Automatically set discriminants of variant records in `New'.
          [Example (variantdemo.pas)]

        - Sets of arbitrary size.  [Example (bigsetsdemo.pas)]

   * From Extended Pascal:

        - Strings of arbitrary length.  [Example (stringschemademo.pas)]

        - `ReadStr' and `WriteStr'.  Read from and write to strings
          with the full comfort of `ReadLn'/`WriteLn'. [Example
          (rwstringdemo.pas)]

        - System-independent date/time routines.  [Example
          (datetimedemo.pas)]

        - Set member iteration:
          `for Ch in ['A' .. 'Z', 'a' .. 'z'] do ...' [Example
          (bigsetsdemo.pas)]

        - Set extensions (symmetric difference, `Card')

        - Generalized `Succ' and `Pred' functions
          (`foo := Succ (bar, 5);').

        - Complex numbers.  [Example (mandelbrot.pas)] [Example
          (parserdemo.pas)]

        - Exponentiation operators (`pow' and `**') for real and
          complex numbers.

        - Initialized variables.  [Example (initvardemo.pas)]

        - Functions can return array or record values.

        - Return value variables.  [Example (returnvardemo.pas)]

        - Modules.

        - Non-decimal numbers in base 2 through 36: `base#number'.

        - `MinReal', `MaxReal', `EpsReal', `MaxChar' constants.

        - Schemata - the Pascal way to get dynamic arrays without dirty
          tricks. [Example (schemademo.pas)]

        - Local variables may have dynamic size.  [Example
          (dynamicarraydemo.pas)]

        - Array Slice Acces - access parts of an array as a smaller
          array, even on the left side of an assignment [Example
          (arrayslicedemo.pas)]

   * Compatible to Borland Pascal 7.0 with objects (BP):

        - Supports units, objects, ..., and makes even things like
          `absolute' variables portable.  [Example (absdemo.pas)]

        - Comes with portable versions of the BP standard units with
          full source.

        - True network-transparent CRT unit: You can run your CRT
          applications locally or while being logged in remotely,
          without any need to worry about different terminal types.
          Compatible to BP's unit, but with many extensions, such as
          overlapping windows.  [Example (crtdemo.pas)]

        - Fully functional GUI (X11) version of CRT (also completely
          network transparent).

        - The `Random' function can produce the same sequence of
          pseudo-random numbers as BP does - if you need that instead
          of the much more elaborate default algorithm.

        - Supports BP style procedural variables as well as Standard
          Pascal's procedural parameters.  [Example (procvardemo.pas)]

        - A `Ports' unit lets you access CPU I/O ports on systems where
          this makes sense. [Example (portdemo.pas)]

        - Special compatibility features to help migrating from BP to
          GPC, like a `GPC for BP' unit which provides some of GPC's
          features under BP, and some routines to access sets of large
          memory blocks in a uniform way under GPC and BP (even in real
          mode).  [Example (bigmemdemo.pas)]

   * From Pascal-SC (PXSC):

        - User-definable operators. Add your vectors with `+'.

   * Carefully designed GNU extensions help you to make your real-world
     programs portable:

        - 64-bit signed and unsigned integer types.

        - A Delphi-compatible `SetLength' procedure for strings makes
          it unnecessary to use dirty tricks like assignments to the
          "zeroth character".

        - Special types guarantee compatibility to other GNU languages
          such as GNU C. Directives like `{$L foo.c}' make it easy to
          maintain projects written in multiple languages, e.g.,
          including code written in other languages into Pascal programs
          [Example (Pascal part) (c_gpc.pas)] [Example (C part)
          (c_gpc_c.c)],

        - or including Pascal code into programs written in other
          languages.  [Example (Pascal part) (gpc_c_pas.pas)] [Example
          (Pascal unit) (gpc_c_unit.pas)] [Example (C part) (gpc_c_c.c)]

        - Extensions like `BitSizeOf' and `ConvertFromBigEndian' help
          you to deal with different data sizes and endianesses.
          [Example (endiandemo.pas)]

        - Little somethings like `DirSeparator', `PathSeparator',
          `GetTempDirectory' help you to write programs that look and
          feel "at home" on all operating systems.

        - The `PExecute' routine lets you execute child processes in a
          portable way that takes full advantage of multitasking
          environments. [Example (pexecutedemo.pas)]

        - The GNU GetOpt routines give you comfortable access to
          Unix-style short and long command-line options with and
          without arguments. [Example (getoptdemo.pas)]

        - Routines like `FSplit' or `FSearch' or `FExpand' know about
          the specifics of the various different operating systems.
          [Example (fexpanddemo.pas)]

   * Useful and portable GNU standard units:

        - A `Pipe' unit gives you inter-process communication even
          under plain DOS. [Example (pipedemo.pas)] [Demo process for
          the example (demoproc.pas)]

        - With the GNU RegEx unit you can do searches with "regular
          expressions". [Example (regexdemo.pas)]

        - The GNU MultiPrecision (GMP) unit allows you to do
          arithmetics with integer, real, and rational numbers of
          arbitrary precision.  [Example: factorial (factorial.pas)]
          [Example: fibonacci (fibonacci.pas)] [Example: power
          (power.pas)] [Example: real power (realpower.pas)] [Example:
          pi (pi.pas)]

        - Posix functions like `ReadDir', `StatFS' or `FileLock'
          provide an efficient, easy-to-use and portable interface to
          the operating system. [Example (readdirdemo.pas)] [Example
          (statfsdemo.pas)] [Example (filelockdemo.pas)]

        - A `DosUnix' unit compensates for some of the
          incompatibilities between two families of operating systems.
          [Example (dosunixdemo.pas)]

        - An `MD5' unit to compute MD5 message digests, according to
          RFC 1321. [Example (md5demo.pas)]

        - A `FileUtils' unit which provides some higher-level file and
          directory handling routines.  [Example (findfilesdemo.pas)]

        - A `StringUtils' unit which provides some higher-level file
          and directory handling routines.  [Example
          (stringhashdemo.pas)]

        - A `Trap' unit to trap runtime errors and handle them within
          your program. [Example (trapdemo.pas)]

   The demo programs mentioned above are available both on the WWW and
in GPC source and binary distributions.

   Disadvantages:

   * The GNU debugger (GDB) does not yet understand Pascal syntax and
     types; you have to use C syntax when debugging Pascal programs
     with GDB.

   * With GPC you get longer compilation times than with, e.g., Borland
     Pascal.

   *Co-workers welcome!*

   Able, committed programmers are always welcome in the GNU Pascal
team. If you want to be independent of companies that you must pay for
getting a compiler with more restrictive licensing conditions that only
runs on _one_ operating system, be invited to join the development
team, *Note Contributors::.


File: gpc.info,  Node: News,  Next: FAQ,  Prev: Highlights,  Up: Top

New Features of GNU Pascal.
***************************

   There's a large number of bug fixes, too many to mention here. They
are listed in the `Fixed Bugs' section of the GPC To-Do list, *Note
Fixed Bugs::.

   The most important bugs fixed include the unit/module initialization
done in the wrong order, and not working at all on some systems, the
global goto bug, some "two-unit bugs" and a number of BP compatibility
issues.

   There's a number of new or changed features which are listed in the
following sections. Features without further description refer to new
routines or options.

* Menu:

* News - General Changes And Possible Incompatibilies To Previous Versions::
* News - Command Line Options and Compiler Directives::
* News - Compiler and RTS Built-in Declarations::
* News - Units::
* News - GPC Manual::
* News - Demo Programs::
* News - Test Suite::
* Legend::


File: gpc.info,  Node: News - General Changes And Possible Incompatibilies To Previous Versions,  Next: News - Command Line Options and Compiler Directives,  Up: News

General Changes And Possible Incompatibilies To Previous Versions
=================================================================

   This release of GPC has been cleaned up substantially. Consequently,
a few old and obsolete features have been dropped or replaced by
cleaner, more flexible or otherwise more useful ones. This might lead
to minor problems with old programs, but we suppose they're very rare
(many programmers might not even know about the old features) and easy
to overcome. The most important ones are listed here, the rest of them
is contained in the following sections and marked with `(@)'.

   * The executables `bpc', `pc' and `epc' have been dropped. What they
     did was equivalent to `gpc --borland-pascal', `gpc
     --standard-pascal' or `gpc --extended-pascal', respectively, and
     you can use these forms now. If you need them often, you can put
     them in scripts or aliases called `bpc' etc., of course.

   * `asmname' in variable and constant declarations must now come
     after the type (e.g. `var foo : Integer = 42; asmname 'bar';').
     Furthermore, `asmname' doesn't imply `external' anymore for
     variables.

   * The internal file handling in the RTS was changed from using
     `FILE *' pointers to integer file handles, to make it more
     efficient and to get rid of some problems. Accordingly, the
     `CFile' field in `BindingType' was replaced by a `Handle' field,
     the `AssignCFile' procedure by an `AssignHandle' procedure, and
     the `GetFile' function was removed (a substitute is the function
     `FileHandle' which has already existed in previous releases).

   * The option `--no-nested-comments' (to allow comments like `{ *)'
     as the standard requires) has been renamed to `--mixed-comments'
     (note the inverted value). Accordingly, the compiler directives
     `{$N+}' and `{$N-}' have been renamed to `{$no-mixed-comments}' and
     `{$mixed-comments}'. The default, when no dialect options are
     given, is still `--no-mixed-comments' (i.e., what used to be
     `--nested-comments').

   * A new option `--nested-comments' to allow real nested comments
     like `{ { } }' (also available as a compiler switch, like almost
     all command-line options). Note the new meaning of this switch, so
     if you used it before, you'll probably have to change it to
     `--no-mixed-comments' (see above). If nested comments are enabled,
     comments are also allowed within compiler directives and macros -
     however, compiler directives within other compiler directives are
     still not allowed, and compiler directives within comments are, of
     course, still ignored.

   * C style character escapes (`\n', `\007' etc.) are now the default
     for strings enclosed in double quotes, while single quoted strings
     do not allow them (according to the standard).  Accordingly, a
     verbatim `"' in a double quoted string is now obtained with `\"'
     rather than `""' (but a verbatim `'' in a single quoted string
     still with `''', of course). Therefore, the option
     `--[no-]char-escapes' and the compiler directives `{$E+}'/`{$E-}'
     have been dropped.  If you used these features, please change to
     the appropriate kind of quotes.

   * Macros are no more expanded in `--borland-pascal' and `--delphi'
     modes. Expanding them causes a few problems with strange sources
     written for BP which use the same name for a conditional define
     and an identifier. Macros can be turned on/off, independently of
     the dialect, with the new switches `--[no-]macros'. (B)

   * Macros and conditionals defined with `{$define}' are now
     case-insensitive. (B) Macros and conditionals defined with
     `--define' on the command line are still case-sensitive for
     compatibility to other GNU compilers. In addition, GPC provides
     `{$csdefine}' or `--csdefine' and `{$cidefine}' or `--cidefine' to
     define case sensitive or insensitive macros or conditionals,
     respectively. If you have defined macros or conditionals with
     `{$define}' and rely on them being case-sensitive, change it to
     `{$csdefine}' now.

   * The mechanism for including GPC code into code written in other
     languages has changed and is now more robust. A header gpc-in-c.h
     is provided for inclusion of GPC code into C programs, and a demo
     program GPC_C_Pas (together with C code calling it) is supplied to
     demonstrate this. (Including C code into GPC programs works as
     before.)

   * The preprocessor is now called `gpcpp' (it was `gpc-cpp' before).
     If you have installed an older GPC version, please remove gpc-cpp
     now. If you have any scripts that refer to gpc-cpp directly,
     change the reference to gpcpp. If you use DJGPP, and you added the
     GPC specific sections to djgpp.env as described in the FAQ, please
     change `[gpc-cpp]' to `[gpcpp]'.

   * In `--borland-pascal' mode, GPC now ignores everything after
     `end.'. (This also takes care of "^Z" characters at the end of Dos
     text files). In particular, multiple units or modules in one file
     don't work anymore in `--borland-pascal' mode. (B)


File: gpc.info,  Node: News - Command Line Options and Compiler Directives,  Next: News - Compiler and RTS Built-in Declarations,  Prev: News - General Changes And Possible Incompatibilies To Previous Versions,  Up: News

Command Line Options and Compiler Directives
============================================

   * `{$ifopt}' works now, with short directives like in BP (`{$ifopt
     X+}') (B) and also with long directives (`{$ifopt
     extended-syntax}')

   * Local compiler directives and defines can be specified with
     `{$local}' and `{$endlocal}'.

   * Delphi (or C++) style `//' comments in default and `--delphi'
     modes, and a switch `--[no-]delphi-comments' to turn them on/off
     explicitly. (D)

   * -W[no-]typed-const (warn about BP style misuse of typed constants)

   * -W[no-]near-far (warn about use of the obsolete BP compatible
     `near' and `far' directives)

   * -W[no-]underscore (warn about double/leading/trailing underscores
     in identifiers)

   * -W[no-]mixed-comments (warn about use of mixed comments)

   * -W[no-]nested-comments (warn about use of nested comments)

   * -W[no-]field-name-problem (don't warn about a problem with field
     names)

   * -W[no-]warnings (enable/disable warnings)

   * All `-Wfoo' warning options also work as `{$W foo}' compiler
     directives. In contrast to the last alpha release, there must now
     be a space after the `W'. (@)

   * -no-default-paths (disable standard unit etc. paths)

   * -no-unit-path, -no-object-path (disable any unit/object paths
     given so far)

   * -[no-]io-checking (same as `{$I+}', `{$I-}')

   * -[no-]stack-checking, also as compiler directives
     `{$[no-]stack-checking}' or `{$S+}'/`{$S-}' (B)

   * -[no-]typed-address, also as compiler directives
     `{$[no-]typed-address}' or `{$T+}'/`{$T-}' (B)

   * -[no-]transparent-file-names (derive the external file names from
     the file variable names

   * -[no-]progress-messages, -[no-]progress-bar (output information to
     give progress messages or display a progress bar while compiling,
     using suitable utilities)

   * {$[no-]debug-statement[=foo]} (call a procedure automatically
     before each statement for debugging)

   * The `--[no-]c-numbers' switch has been removed. If you really used
     C style octal or hex numbers (`0400', `0xf00'), you can easily
     convert them to the Extended Pascal notation (`8#400', `16#f00')
     or (hex only) to the Borland Pascal notation (`$foo'). (@)

   * `{$gnu-pascal}' is now completely equivalent to `--gnu-pascal';
     `{$gnu-pascal}' has been added to all units shipped with GPC, so
     they can also be compiled when `--borland-pascal' or other dialect
     options are given on the command line.

   * `{$if}' directives now understand Pascal operators like `and',
     `or', `not' (C operators are also still understood).

   * `{$P+}'/`{$P-}' was replaced by `{$[no-]pedantic}' (or
     `--[no-]pedantic' on the command line)

   * The single-letter compiler directives are now BP compatible.
     Those that are not meaningful or not necessary in GPC (e.g.
     `{$F+}', `{$O...}', or `{$M}' with only numbers following) are
     ignored in `--borland-pascal' mode and warned about otherwise. (B)
     Note: `{$W+}'/`{$W-}' is now also ignored in `--borland-pascal'
     mode (it is the only single-letter directive left that has a
     different meaning in BP and in GPC, and besides, the BP meaning
     can be safely ignored in GPC).  To enable/disable warnings in
     `--borland-pascal' mode, you can use `{$W [no-]warnings}' now. (@)

   * The RTS command line options are now also available as long
     options; new RTS options `--version' (print RTS version and exit),
     `--abort-on-error' (abort with SIGABRT on runtime error),
     `--error-file', `--error-fd' (dump runtime error messages and
     strack trace to given file name or FD).

   * RTS command line options are now recognized after `--gpc-rts'
     instead of `-Grts'. Also, a single option can be given with
     `--gpc-rts=OPTION'. This is allowed multiple times. (@)

   * Files with `.pp' or `.dpr' extension are recognized as Pascal
     sources. (D)



File: gpc.info,  Node: News - Compiler and RTS Built-in Declarations,  Next: News - Units,  Prev: News - Command Line Options and Compiler Directives,  Up: News

Compiler and RTS Built-in Declarations
======================================

   Some of the following declarations are built into the compiler,
others are declared in the `GPC' module.

   * Types etc.:

        - `nil' is accepted as a value of any procedural/functional
          type (B)

        - ByteBool, ShortBool, WordBool, MedBool, LongBool, LongestBool,
          Boolean(42) (D?)

        - `register' directive

        - Directives with double underscores like `__asmname__',
          `__inline__' have been dropped. The same directives without
          underscores have been available for a long time. Furthermore,
          GPC now supports `^const' to create a pointer to a constant
          (which could be done in a C like fashion with the `__const__'
          directive before). (@)

        - Type qualifiers like `__byte__' or `__unsigned__' have been
          dropped. GPC has been supporting "real" type names like
          `Byte' or `ByteWord' for a long time, and it's easy to change
          to them. Similar for `__cstring__' and `__void__' where
          `CString' and `Void' are available. (@)

        - `mod' with negative right operand now works like in BP. (B)

        - Expressions like `-2 * +3' are now allowed without
          parentheses. (B)

   * Files and I/O:

        - SeekEOF, SeekEOLn (B)

        - IOErrorFile

        - New parameter `ElementSize' to ReverseBytes,
          ConvertFromLittleEndian, ConvertFromBigEndian,
          ConvertToLittleEndian, ConvertToBigEndian,
          BlockReadLittleEndian, BlockReadBigEndian,
          BlockWriteLittleEndian, BlockWriteBigEndian (@)

        - ReadStringLittleEndian

        - ReadStringBigEndian

        - WriteStringLittleEndian

        - WriteStringBigEndian

        - PathExists

        - DataDirectoryName

        - AssignBinary

        - HasWildCardsOrBraces

        - BraceExpand

        - MultiFileNameMatch

        - GlobOn

        - MultiGlob

        - MultiGlobOn

        - QuoteFileName

        - UnQuoteFileName

        - FExpandQuoted

        - ForceAddDirSeparator

        - FindNonQuotedChar

        - FindNonQuotedStr

        - NameExtFromPath

        - SystemInfo

        - GetMountPoint

        - FileMove

        - ChMod

        - IOSelect

        - IOSelectRead

        - FileNameLoCase

        - FileNamesCaseSensitive (constant)

        - DirRoot (constant)

        - QuotingCharacter (constant)

        - EnvVarChars (constant)

        - EnvVarCharsFirst (constant)

        - WildCardChars (constant)

        - FileNameSpecialChars (constant)

        - ShellExecCommand (constant)

        - DataReady renamed to CanRead (@)

        - FileLock, FileUnlock

        - MemoryMap, MemoryUnMap

        - New parameter `Quoted' to RelativePath (@)

        - New parameter `Prefix' to ConfigFileName (@)

        - New parameter `AccessTime' to SetFileName (@)

        - ExpandEnvironment recognizes `~user'

        - Each of the parameters `Dir', `Name' and `Ext' to `FSplit'
          may now be null.

        - New fields `User', `Group', `Mode', `Device', `INode',
          `SymLink', `TextBinary' and `Special' in BindingType

        - The variable `TextFilesBinary' has been dropped. Instead, you
          can now use the procedure `AssignBinary' or the field
          `TextBinary' in BindingType. (@)

        - File sizes can now be bigger than `Integer' (e.g. 64 bit
          files on 32 bit machines) if supported by the OS via
          lseek64() or llseek() (e.g. Linux, Solaris, IRIX).

        - Renamed the file mode constants from `fmFOO' to `fm_FOO'. (@)

        - `GetIOErrorMessage' now returns a string rather than a
          `CString'. (@)

        - In `GlobBuffer', the fields `Count' and `Result' (pointer to
          an array of `CString's, 0 baser) were replaced by `Result', a
          pointer to an array of pointers to strings, 1 based). (@)

   * Strings:

        - Integer2String

        - IsUpCase

        - IsLoCase

        - IsAlphaNum

        - IsAlphaNumUnderscore

        - IsPrintable

        - Renamed the CString routines in the RTS so they get a
          `CString' prefix, moved the BP compatibility identifiers for
          the same routines into the `Strings' unit (B) (@)

        - MemCompCase

        - StrEqualCase

        - PosCase

        - LastPosCase

        - PosFromCase

        - LastPosTillCase

        - IsPrefixCase

        - IsSuffixCase

        - LineBreak (constant)

        - SetEnv (makes obsolete libc's PutEnv (@))

        - UnSetEnv

        - GetCEnvironment

        - DisposePPStrings

        - The environment variable management is now implemented in
          Pascal, so it's independent of libc differences (e.g. the
          presence or not of `environ'). Access via `GetEnv' etc. works
          unchanged.

        - The `Environment' variable is now a schema which contains the
          environment variables as CStrings. (@)

        - Empty and case-sensitive environment variables are allowed
          within GPC programs even under Dos.

   * Random:

        - SeedRandom

        - SeedRandomPtr (variable)

        - Randomize is called automatically when necessary (except when
          using the BP compatible random number generator in the System
          unit (B)).

   * Memory:

        - ReAlloc; previous ReAlloc function (libc) renamed to CReAlloc
          (@)

        - ReAllocPtr (variable)

        - ReleaseCount

        - AllocateBigMem, DisposeBigMem, MoveToBigMem, MoveFromBigMem,
          MapBigMem for uniform access to big memory blocks for GPC and
          BP (B)

   * Time:

        - Sleep

        - SleepMicroSeconds

        - Alarm

        - GetCPUTime

        - GetMicroSecondTime

        - DayOfWeekName (constant)

   * Misc:

        - Include and Exclude for sets (B)

        - IsInfinity

        - IsNotANumber

        - SplitReal

        - ReturnAddress

        - FrameAddress

        - Runtime errors are now printed with their address to help
          debugging (using addr2line), and the address is stored in
          ErrorAddr. (B)

        - RegisterRestoreTerminal

        - UnregisterRestoreTerminal

        - RestoreTerminal

        - ExecuteNoTerminal

        - SetProcessGroup

        - SetTerminalProcessGroup

        - GetTerminalProcessGroup

        - GetTerminalName

        - SetInputSignals

        - GetInputSignals

        - GetShellPath

        - GetPasswordEntryByName

        - GetPasswordEntryByUID

        - GetPasswordEntries

        - StrSignal

        - Kill

        - WaitPID

        - InstallSignalHandler

        - BlockSignal

        - SignalBlocked

        - Constants for the signals

        - UserID

        - GroupID

        - IllReservedAddress, IllPriviledgedInstruction, IllReservedOp
          were removed. (@)



File: gpc.info,  Node: News - Units,  Next: News - GPC Manual,  Prev: News - Compiler and RTS Built-in Declarations,  Up: News

GPC Units
=========

   * CRT:

        - Works now under Cygwin and mingw.

        - DJGPP: support for 40 column modes (requires updated PDCurses
          library)

        - Renamed the the conditional to get an X11 version from
          XCURSES to X11. (@)

        - Renamed GetScreenSize to ScreenSize (WinCRT compatibility)
          (B) (@)

        - WindowOrg, WindowSize, Cursor, Origin, InactiveTitle,
          AutoTracking, WindowTitle, (variables), ScrollTo, TrackCursor
          (WinCRT compatibility) (B)

        - SimulateBlockCursor, SimulateBlockCursorOff

        - Curses is not initialized at the beginning of the program, but
          rather when the first CRT routine is called. (B)

        - CRTInit to explicitly initialize CRT and also set some
          defaults (PCCharSet and update level) to more natural (and
          less BP compatible) values.

        - CRTSetTerminal

        - CRTAutoInitProc (variable)

        - CRTNotInitialized

        - CRTSavePreviousScreen

        - CRTSavePreviousScreenWorks

        - Any of the parameters to GetWindow may now be null.

        - Support for panels (overlapping windows): GetActivePanel,
          PanelNew, PanelDelete, PanelBindToBackground,
          PanelIsBoundToBackground, PanelActivate, PanelHide, PanelShow,
          PanelHidden, PanelTop, PanelBottom, PanelMoveAbove,
          PanelMoveBelow, PanelAbove, PanelBelow, IgnoreCursor

        - Replaced the variables PCCharSet and UseControlChars by
          routines SetPCCharSet, GetPCCharSet, SetControlChars,
          GetControlChars. (@)

        - SetScreenSize

        - SetMonochrome

        - Renamed IsMonoMode to IsMonochrome. (@)

        - On ncurses platforms, changing the screen is now done through
          a shell command definable in the environment variable
          `RESIZETERM' (which defaults to `resize', `SVGATextMode' and
          `setfont'). The variables `crt_setfont_command_80_25',
          `crt_setfont_command_80_50', `crt_setfont_command_40_25' and
          `crt_setfont_command_40_50' (Linux only) were removed. (@)

        - CRTUpdate

        - CRTRedraw

        - SetScroll

        - CRTSetCursesMode

        - RestoreTerminalClearCRT

        - CtrlKey

        - AltKey

        - constants chCtrlA ... chCtrlZ, kbCtrlA ... kbCtrlZ

        - Catch some signals and return pseudo function keys for them if
          CheckBreak is False.

        - React to screen size changes by external events and return a
          pseudo function key.

        - Reduced the (already small) system-dependent code, and added
          an overview of the few problematic features in the comment at
          the beginning of crt.pas.

   * RegEx:

        - RegExPosFrom

        - CharSet2RegEx

        - Support for converting subexpression or complete matching
          references to upper or lower case while replacing them with
          `\u7' or `\l7'.

   * GMP:

        - mpf_exp

        - mpf_ln

        - mpf_pow

        - mpf_arctan

        - mpf_pi

        - The unit now works with version 3.x of the GMP library, but it
          also still works with version 2.x.

   * System:

        - SetTextBuf (B)

        - RealToBPReal, BPRealToReal to convert between binary BP
          compatible 6 byte reals and GPC's reals (useful, e.g., for
          binary file exchange with BP programs) (B)

        - Ofs, Seg, Ptr, CSeg, DSeg, SSeg, SPtr (mostly useless and only
          for BP compatibility) (B)

        - A number of variables like SelectorInc (mostly useless and
          only for BP compatibility) (B)

        - Renamed the `__BP_INTEGERS__' conditional to
          `__BP_TYPE_SIZES__'. (@)

   * Dos, WinDos:

        - GetCBreak

        - SetCBreak

        - GetVerify

        - SetVerify

        - Renamed the `_Borland_16_Bit_' conditional to
          `__BP_TYPE_SIZES__'. (@)

        - Intr, MsDos, only under DJGPP if `__BP_UNPORTABLE_ROUTINES__'
          is defined. (B)

        - DosVersion, SetDate, SetTime, only if
          `__BP_UNPORTABLE_ROUTINES__' is defined (emulated on
          non-DJGPP). (B)

   * RegEx:

        - In `RegExType', the field `Error' is now of type `PString'
          rather than `CString'. (@)

   * Pipe:

        - New parameter `Process' to Pipe (@)

        - WaitPipeProcess

   * PExecute:

        - Integrated into the RTS so you don't need a `uses PExecute'
          anymore. (@)

   * GetOpt:

        - ResetGetOpt

        - `GetOptErrorFlag' is now True by default. (@)

        - Integrated into the RTS so you don't need a `uses GetOpt'
          anymore. (@)

        - Renamed the variables and constants used (see gpc.pas under
          `Command Line Option Parsing'). (@)

        - `GetOptLong' can now optionally derive the short options from
          the `LongOptions' array.

   * WinCRT:

     New unit (identical to CRT) (B)

   * HeapMon:

     New unit for (simple) heap checking.

   * Trap:

     New unit for runtime error trapping.

   * MD5:

     New unit for computing MD5 message digests.

   * FileUtils:

     New unit with some file and directory utilities.

   * StringUtils:

     New unit with some string utilities.

   * GPC-BP:

     A `GPC' unit for BP to provide some GPC compatibility to BP
     programs and make it easier to gradually convert them to GPC. (G)


   A few of the units (in particular: CRT, GMP and RegEx) require
libraries. The sources of the libraries, with small patches where
necessary, as well as binaries for i586-pc-linux-gnu,
i586-pc-linux-gnulibc1, m68k-linux, sparc-sun-solaris2, i386-pc-go32,
i386-pc-cygwin32 and i386-pc-mingw32 are available from
     `ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/libs/'


File: gpc.info,  Node: News - GPC Manual,  Next: News - Demo Programs,  Prev: News - Units,  Up: News

GPC Manual
==========

   * Some very obsolete sections of the manual (e.g., the output of
     running the PVS test suite on an Alpha machine in 1995 ;-) were
     removed.

   * The manual was restructured. Several partly overlapping chapters
     were included into the Programmer's Guide, and the overlapping
     material was merged into more coherent sections.

   * The BP QuickStart Guide was left a separate chapter and completed
     with a section about differences between BP and GPC, especially
     mentioning endianness issues.

   * A lot of new material was added to the `Programming' and
     `Reference' chapters.

   * The list of command-line options and the list of keywords for the
     various dialects were updated, and from now on, they are
     automatically kept up to date, directly from the source. The
     `Invoking GPC' chapter does not contain all options inherited from
     GCC anymore (these can be found in the GCC manual, anyway), but
     rather more extensive descriptions of the most commonly used GPC
     options, with examples.

   * The interface of all units included with GPC, together with a
     short description of the units, is now included in the manual. The
     interface, also that of the `GPC' module which describes the
     interface to the Run Time System, is formatted more nicely,
     especially in the printed version of the manual.

   * The `Support' chapter was updated, now including information about
     GPC's Test Suite and how to report bugs most effectively, as well
     as up-to-date contact information.

   * The installation instructions were updated, now matching the
     current GPC and GCC versions.

   * The FAQ, the To-Do list, and the list of new features (this one
     :-) were integrated into the manual.

   * The list of authors in the manual was updated, and the list of
     contributors was included from the WWW page.

   * The manual was integrated with GPC's WWW pages, i.e. most of the
     WWW pages were synchronized with the corresponding information in
     the manual, and both now contain the same information.



File: gpc.info,  Node: News - Demo Programs,  Next: News - Test Suite,  Prev: News - GPC Manual,  Up: News

Demo Programs
=============

   * There is a number of new demo programs to demonstrate some
     features of the compiler and the units. The demo programs are part
     of source and binary GPC distributions. After installation, they
     can be found in `<prefix>/doc/gpc/demos/'.

   * The demo programs printed in the GPC Manual (currently 186, but
     expected to become more) are now installed as separate files,
     ready to be compiled, in a directory `<prefix>/doc/gpc/docdemos/'.



File: gpc.info,  Node: News - Test Suite,  Next: Legend,  Prev: News - Demo Programs,  Up: News

Test Suite
==========

   The Test Suite is used to verify that all features of GPC work as
expected and to reproduce bugs reported. Test programs for bugs found
by users and for new features are constantly added. The test suite is
part of source, not binary, GPC distributions.

   * As usual, many new tests have been added to the Test Suite.

   * The few checks dependent on the system or certain installed tools
     or libraries have been equipped with checks about the system
     properties, and are skipped on systems on which they are not
     applicable.

   * The old dejagnu tests have been integrated into the Test Suite.

   * `pascal.check' (or `check-pascal') now runs the current Test Suite
     (as `make check2-gpc' did before) rather than the (now removed)
     dejagnu tests. This must be done in the build directory (not the
     `p' subdirectory) or in the `test' subdirectory of the source
     directory. (@)

   * The Test Suite now produces a summary output by default. To get
     the long output format as before, run `make pascal.check-long' (or
     `check-pascal-long') now.

   * The GPC Manual as well as the `test/README' file in source
     distributions (or `BUGS' in binary distributions) tells you how to
     run the Test Suite and describes all features of the testing
     environment, to make it easier for users to construct even exotic
     new tests, and contains some generic instructions on how to report
     bugs.  See *Note Testing::, and see *Note Reporting Bugs::.


File: gpc.info,  Node: Legend,  Prev: News - Test Suite,  Up: News

Legend
======

`(@)':   minor backward-incompatibility
`(B)':   BP compatibility
`(D)':   Delphi compatibility
`(G)':   GPC compatibility :-)

   Have fun,

   The GNU Pascal Development Team


File: gpc.info,  Node: FAQ,  Next: Installation,  Prev: News,  Up: Top

The GNU Pascal Frequently Asked Questions List.
***********************************************

Edition 0.9, August 2000
------------------------

   This is the Frequently Asked Questions List (FAQ) for GNU Pascal. If
the FAQ and the documentation do not help you, you have detected a
*bug* in it which should be reported, *Note Mailing List::.  Please
really do it, so we can improve the documentation.

* Menu:

* GNU Pascal::          GNU Pascal
* Installing GPC::      Installing GPC
* GPC on DJGPP::        GNU Pascal on the DJGPP (MS-DOS) platform
* Strings in GPC::      Strings
* Getting Help::        Getting Help
* Miscellaneous FAQ::   Miscellaneous


File: gpc.info,  Node: GNU Pascal,  Next: Installing GPC,  Up: FAQ

GNU Pascal
==========

* Menu:

* What and why::                What and why?
* Current version::             What is the current version?
* Turbo Pascal compatibility::  Is it compatible with Turbo Pascal (R)?
* Supported platforms::         Which platforms are supported by GNU Pascal?


File: gpc.info,  Node: What and why,  Next: Current version,  Up: GNU Pascal

What and why?
-------------

   The purpose of the GNU Pascal project is to produce a Pascal
compiler (called GNU Pascal or GPC) which

   * combines the clarity of Pascal with powerful tools suitable for
     real-life programming,

   * supports both the Pascal standard and the Extended Pascal standard
     as defined by ISO, ANSI and IEEE (ISO 7185:1990, ISO/IEC
     10206:1991, ANSI/IEEE 770X3.160-1989),

   * supports other Pascal standards (UCSD Pascal, Borland Pascal,
     Pascal-SC) in so far as this serves the goal of clarity and
     usability,

   * may be distributed under GNU license conditions, and

   * can generate code for and run on any computer for which the GNU C
     compiler can generate code and run on.

   Pascal was originally designed for teaching. GNU Pascal provides a
smooth way to proceed to challenging programming tasks without learning
a completely different language.

   The current release implements Standard Pascal (ISO 7185, level 1),
a large subset of Extended Pascal (ISO 10206, aiming for full
compliance), is highly compatible to Borland Pascal (version 7.0) with
some Delphi extensions, and provides a lot of useful GNU extensions.


File: gpc.info,  Node: Current version,  Next: Turbo Pascal compatibility,  Prev: What and why,  Up: GNU Pascal

What is the current version?
----------------------------

   Prior to July 2000 releases were several months apart. Since then
there has been a new release every few days, available as a source
archive or from a CVS server from the GPC web site,
`http://home.pages.de/~GNU-Pascal/'.

   For details about new features, see the section `News' on the web
site. On bugs fixed recently, see the `Done' section of the To-Do list
(on the same web site).

   GPC uses GCC as a back-end. Patches for GCC 2.8.1 and GCC 2.95.x are
provided but it is recommended that you use GCC 2.95.x.


File: gpc.info,  Node: Turbo Pascal compatibility,  Next: Supported platforms,  Prev: Current version,  Up: GNU Pascal

Is it compatible with Turbo Pascal (R)?
---------------------------------------

   GPC is not a drop-in replacement for Borland's Turbo Pascal (R).
Almost all BP language features are supported. Notable exceptions are
the string format (as discussed below), or the `Mem' and `Port' pseudo
arrays, though replacement functions for the latter on x86 platforms
exist in the `Ports' unit.

   Almost all of BP's run time library is supported in GPC, either by
built-in compiler features or in units with the same names as their BP
counterparts.

   For details about the compatibility, the few remaining
incompatibilities and some useful alternatives to BP features, see the
`Borland Pascal' chapter in the GPC Manual.  (*note Borland Pascal::)

