This is ../p/doc/info/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-2002 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: Keywords,  Next: Support,  Prev: Reference,  Up: Top

Pascal keywords and operators supported by GNU Pascal.
******************************************************

   This chapter lists all keywords understood by GNU Pascal.

   By default, keywords can be redefined to make it possible that every
correct ISO 7185 program can be compiled. However, you can use the
compiler dialect switches (e.g., `--extended-pascal' or
`--borland-pascal') to tell GPC that keywords of a given standard must
not be redefined.

   The keywords are taken from the following standards:

   * ISO 7185 Pascal (SP)

   * ISO 10206 Extended Pascal (EP)

   * ANSI draft Object Pascal (OP)

   * USCD Pascal (USCD)

   * Borland Pascal 7.0 (BP)

   * Borland Delphi (BD)

   * Pascal-SC (PXSC, Pascal eXtensions for Scientific Calculations)

   * VAX Pascal (VP)

   * GNU Pascal extensions (GPC)

   In GPC you are free to re-define everything that is not a reserved
word in ISO 7185 Pascal in your program or the dialect selected.  E.g.,
you do not have to modify your code for GPC if you have an identifier
like `Restricted' or `Value' or some such, unless you compile with the
`--extended-pascal' option.

   The following table lists all known keywords with short
descriptions. The links point to the longer descriptions in the
reference.

absolute (BP, BD, GPC) (*note absolute::)
     overloaded variable declaration

abstract (OP, GPC) (*note abstract::)
     abstract object type or method declaration

all (GPC) (*note all::)
     `export' (*note export::) extension (`export foo = all')

and (any) (*note and::)
     Boolean or bitwise `and' operator or part of the `and then' (*note
     and then::) operator

and_then (EP, OP, GPC) (*note and_then::)
     short-circuit Boolean `and' (*note and::) operator

array (any) (*note array::)
     array type declaration

as (OP, BD, GPC) (*note as::)
     object type membership test and conversion

asm (BP, BD, GPC) (*note asm::)
     GNU style inline assembler code

asmname (GPC) (*note asmname::)
     linker name of routines and variables

attribute (GPC) (*note attribute::)
     attributes of routines and variables

begin (any) (*note begin::)
     begin of a code block, part of a `to begin do' (*note to begin
     do::) module constructor

bindable (EP, OP, GPC) (*note bindable::)
     external bindability of files

case (any) (*note case::)
     multi-branch conditional statement or variant `record' (*note
     record::) type

class (OP, BD, GPC) (*note class::)
     OOE/Delphi style object class (not yet implemented)

const (any) (*note const::)
     constant declaration or constant parameter declaration

constructor (OP, BP, BD, GPC) (*note constructor::)
     object constructor

destructor (OP, BP, BD, GPC) (*note destructor::)
     object destructor

div (any) (*note div::)
     integer division operator

do (any) (*note do::)
     part of a `while' (*note while::) or `for' (*note for::) loop, a
     `with' (*note with::) statement, or a `to begin do' (*note to
     begin do::) or `to end do' (*note to end do::) module constructor
     or destructor

downto (any) (*note downto::)
     part of a `for' (*note for::) loop when counting downwards

else (any) (*note else::)
     alternative part of an `if' (*note if::) statement, default `case'
     (*note case::) label or part of the `or else' (*note or else::)
     operator

end (any) (*note end::)
     end of a code block, end of a `case' (*note case::) statement, end
     of a `record' (*note record::) or object declaration, part of a
     `to end do' (*note to end do::) module destructor

export (EP, OP, BP, BD, GPC) (*note export::)
     module interface export

exports (BP, BD, GPC) (*note exports::)
     library export (not yet implemented)

external (UCSD, BP, BD, GPC) (*note external::)
     declaration of external objects

file (any) (*note file::)
     non-text file type declaration

for (any) (*note for::)
     loop statement where the number of loops is known in advance

forward (UCSD, BP, BD, GPC) (*note forward::)
     declaration of a routine whose definition follows below

function (any) (*note function::)
     function declaration

goto (any) (*note goto::)
     statement to jump to a `label' (*note label::)

if (any) (*note if::)
     conditional statement

import (EP, OP, GPC) (*note import::)
     module interface import

implementation (NOT_SP) (*note implementation::)
     module or unit implementation part

in (any) (*note in::)
     set membership test or part of a `for' (*note for::) loop when
     iterating through sets

inherited (OP, BP, BD, GPC) (*note inherited::)
     reference to methods of ancestor object types

inline (GPC) (*note inline::)
     declaration of inline routines

interface (NOT_SP) (*note interface::)
     module or unit interface part

interrupt (BP, BD) (*note interrupt::)
     interrupt handler declaration (not yet implemented)

is (OP, BD, GPC) (*note is::)
     object type membership test

label (any) (*note label::)
     label declaration for a `goto' (*note goto::) statement

library (BP, BD, GPC) (*note library::)
     library declaration (not yet implemented)

mod (any) (*note mod::)
     integer remainder operator

module (EP, OP, GPC) (*note module::)
     EP style or PXSC style module

nil (any) (*note nil::)
     reserved value for unassigned pointers

not (any) (*note not::)
     Boolean or bitwise `not' operator

object (BP, BD, GPC) (*note object::)
     BP style object declaration

of (any) (*note of::)
     part of an `array' (*note array::), `set' (*note set::) or typed
     `file' (*note file::) type declaration, a `case' (*note case::)
     statement, a variant `record' (*note record::) type or a `type of'
     (*note type of::) type inquiry

only (EP, OP, GPC) (*note only::)
     import specification

operator (PXSC, GPC) (*note operator::)
     operator declaration

or (any) (*note or::)
     Boolean or bitwise `or' operator or part of the `or else' (*note
     or else::) operator

or_else (EP, OP, GPC) (*note or_else::)
     short-circuit Boolean `or' (*note or::) operator

otherwise (EP, OP, GPC) (*note otherwise::)
     default case label

packed (any) (*note packed::)
     declaration of packed `record' (*note record::) or `array' (*note
     array::) types, also packed ordinal subranges

pow (EP, OP, GPC) (*note pow::)
     exponentiation operator with integer exponent

private (BP, BD, GPC) (*note private::)
     private object fields

procedure (any) (*note procedure::)
     procedure declaration

program (any) (*note program::)
     start of a Pascal program

property (OP, BD, GPC) (*note property::)
     variable properties (not yet implemented)

protected (EP, OP, BD, GPC) (*note protected::)
     read-only formal parameters and protected object fields

public (BP, BD, GPC) (*note public::)
     public object fields

published (BP, BD, GPC) (*note published::)
     published object fields

qualified (EP, OP, GPC) (*note qualified::)
     import specification

record (any) (*note record::)
     structured type declaration

repeat (any) (*note repeat::)
     loop statement

resident (BP, BD) (*note resident::)
     library export specification (not yet implemented)

restricted (EP, OP, GPC) (*note restricted::)
     restricted type specification

segment (UCSD) (*note segment::)
     segment specification (not yet implemented)

set (any) (*note set::)
     set type declaration

shl (BP, BD, GPC) (*note shl::)
     bitwise left shift operator

shr (BP, BD, GPC) (*note shr::)
     bitwise right shift operator

static (GPC) (*note static::)
     static variable declaration

then (any) (*note then::)
     part of an `if' (*note if::) statement or part of the `and then'
     (*note and then::) operator

to (any) (*note to::)
     part of a `for' (*note for::) loop when counting upwards or a `to
     begin do' (*note to begin do::) or `to end do' (*note to end do::)
     module constructor or destructor

type (any) (*note type::)
     type declaration or part of a `type of' (*note type of::) type
     inquiry

unit (UCSD, BP, BD, GPC) (*note unit::)
     UCSD and BP style unit declaration

until (any) (*note until::)
     end of a `repeat' (*note repeat::) statement

uses (UCSD, BP, BD, GPC) (*note uses::)
     unit import

value (EP, OP, GPC) (*note value::)
     variable initializer

var (any) (*note var::)
     variable declaration or reference parameter declaration

view (OP, GPC) (*note view::)
     object class view (not yet implemented)

virtual (OP, BP, BD, GPC) (*note virtual::)
     virtual object method declaration

volatile (GPC) (*note volatile::)
     volatile variable declaration

while (any) (*note while::)
     loop statement

with (any) (*note with::)
     automatic `record' (*note record::) or object field access

xor (BP, BD, GPC) (*note xor::)
     Boolean or bitwise `exclusive or' operator


File: gpc.info,  Node: Support,  Next: To Do,  Prev: Keywords,  Up: Top

Where to get support for GNU Pascal; how to report bugs.
********************************************************

   Here you can find information on where to find the most up-to-date
information about GPC, how you can get support (professional or
voluntary), how to use GPC's Test Suite, and how to report new bugs you
might encounter.

   If you have problems with GNU Pascal, please read the relevant
sections of the GPC Manual. The most current version of the manual is
available at `http://www.gnu-pascal.de/gpc-doc.html' for online
browsing.  You can also download the complete manual in HTML format
(tar.gz) (`gpc-html.tar.gz' on GPC's WWW home page).  The manual is
also available in DVI format (gzipped) (`gpc.dvi.gz' on GPC's WWW home
page) and PostScript format (gzipped) (`gpc.ps.gz' on GPC's WWW home
page) for printing.

   If the manual doesn't help you, here is what we recommend you to do:

*Note FAQ::                Check the GPC FAQ

* Menu:

* Mailing List::           Join the GPC Mailing List
* Mailing List Archives::  Look in the Mailing List Archives
* Newsgroups::             Ask in a newsgroup
* Professional Support::   Get individual support for GPC
* Compiler Crashes::       If the compiler crashes ...
* Reporting Bugs::         Find out how to report GPC bugs
* Testing::                If you have GPC sources, learn how to run
                           the Test Suite to test your bugs reported


File: gpc.info,  Node: Mailing List,  Next: Mailing List Archives,  Up: Support

The GPC Mailing List
====================

   There is a mailing list devoted to GNU Pascal. You can write to the
mailing list, e.g. if you have problems installing GPC or if you found
a problem with GPC (please see *Note Reporting Bugs::). You can also
use it to discuss suggestions for improving GPC and, most welcome, to
offer your help or contribute code, documentation or other work. Mails
to the list should be in English.

   To subscribe to the mailing list, send the command
     subscribe gpc your@email.address
   in the body of a mail to <majordomo@gnu.de> (*not* to
`gpc@gnu.de'!). The subject is ignored. (Please replace
`your@email.address' with your real email address.) For more info, send
a line `help' to <majordomo@gnu.de>.

   You can send a message to the mailing list by sending email to the
list address <gpc@gnu.de> as if it were a person.

   To leave the mailing list, send the command
     unsubscribe gpc your@email.address
   to <majordomo@gnu.de>.

   There is also a (low-traffic) announce list, <gpc-announce@gnu.de>
that you can subscribe to stay up-to-date. To subscribe to the list,
write an email with
     subscribe gpc-announce your@email.address
   in the body to <majordomo@gnu.de>. If you like to announce a
contribution, a service or an event related to GPC, you are invited to
post to this list rather than `gpc@gnu.de', but please don't use the
announce list for questions or discussions. Please note that all mail
sent to the announce list is forwarded to the regular list, so you
won't have to subscribe to both lists if you don't want to miss
anything.

   There is also a German speaking mailing list, <gpc-de@gnu.de>. To
subscribe send the command
     subscribe gpc-de your@email.address
   in the body of a mail to <majordomo@gnu.de> (note the hints above).


File: gpc.info,  Node: Mailing List Archives,  Next: Newsgroups,  Prev: Mailing List,  Up: Support

The GPC Mailing List Archives
=============================

   Perhaps your problem was already discussed on the list. There is a
searchable archive of the mailing list on the WWW. It can be browsed or
searched at
     `http://www.gnu-pascal.de/crystal/gpc/en/' (English)
     `http://www.gnu-pascal.de/crystal/gpc/de/' (German)

   The archive of the German GPC list is at
     `http://www.gnu-pascal.de/crystal/gpc-de/de/' (German)
     `http://www.gnu-pascal.de/crystal/gpc-de/en/' (English)


File: gpc.info,  Node: Newsgroups,  Next: Professional Support,  Prev: Mailing List Archives,  Up: Support

Newsgroups relevant to GPC
==========================

   To get support, you can also ask the Usenet newsgroups for help.
There are several Pascal related newsgroups, but none is dedicated just
to GNU Pascal, so use the one which is most appropriate for your
problem. For general Pascal questions, we recommend the following one:

`news://comp.lang.pascal.misc'       Pascal in general and ungrouped
                                     Pascals.

   Pascal syntax related questions may be appropriate in:

`news://comp.lang.pascal.ansi-iso'   Pascal according to ANSI and ISO
                                     standards.

   The next newsgroup is a haven for beginners, answering questions
that would apply to almost any Pascal. However, if you have a
GPC-specific question don't post there - use the GPC mailing list.  And
when in doubt use the GPC mailing list.

`news://comp.lang.pascal.borland'    Borland Pascal questions.

   Don't forget to give back what you have obtained. None of us is
getting money for answering your questions (unless you pay us by
yourself). Please do your part by answering the questions of others
instead.


File: gpc.info,  Node: Professional Support,  Next: Compiler Crashes,  Prev: Newsgroups,  Up: Support

Where to get individual support for GPC
=======================================

   GPC is free software and comes *without any warranty*.

   If you want to get professional support, you can hire an individual
or a company for providing such a service.

   G-N-U GmbH (http://www.g-n-u.de) is doing large parts of the
development of GNU Pascal. This company offers special support for GPC
and can be contacted at <info@g-n-u.de>.

   More generally, to find a company or an individual who offers
support and other consulting services for free software, look into the
GNU Service Directory (http://www.gnu.org/prep/service.html).


File: gpc.info,  Node: Compiler Crashes,  Next: Reporting Bugs,  Prev: Professional Support,  Up: Support

If the compiler crashes ...
===========================

   If the compiler crashes, you have discovered a bug. A reliable
compiler never crashes. To help the maintainers fix this bug, it is
important that you send us a problem report.

   If you're on Unix, you can find out where the compiler crashed if
you enable coredumps, then load the compiler (`gpc1') plus the core
file in the debugger (`gdb /your_path_here/gpc1 core'), then type
`backtrace' to get a stacktrace. Include this stacktrace in your bug
report.


File: gpc.info,  Node: Reporting Bugs,  Next: Testing,  Prev: Compiler Crashes,  Up: Support

How to report GPC bugs
======================

   If you encounter a bug with GPC, please check whether it is one of
the known bugs (*note Known Bugs::). If not, please report it to the
GNU Pascal mailing list (*note Mailing List::). That way, they always
reach the maintainers. Please note the following points.

   * Please send a description of the problem. Try to give as much
     information as possible, with the full text of any error messages
     encountered, or a description of how some output varies from the
     expected output. Always specify the operating system type with
     version and the machine type (try `uname -a' if unsure) as well as
     the version of GPC which you get by typing `gpc -v'.

   * A good article on submitting bug reports can be found at either
     `http://www.chiark.greenend.org.uk/~sgtatham/bugs.html' or
     `http://freshmeat.net/news/2000/02/26/951627540.html'

     Another good article "How To Ask Questions The Smart Way" is
     available as `http://www.tuxedo.org/~esr/faqs/smart-questions.html'


   If the problem is with the compiler itself, not an installation
problem or something like this, please provide a test program to
reproduce the problem, and note the following hints. You can also
contribute test programs for features that are working in GPC to ensure
they will not break in future releases.

   * The test program should be as short as possible, but *by all
     means*, please send a *complete* program and *make sure* that it
     still reproduces the problem before you send it. Too often, users
     have sent code which contained obvious syntax errors far before
     the actual problem, or just code fragments that we could only make
     wild guesses about. This is unproductive for us and doesn't help
     you get your problem solved.


   The preferred form for test programs is the form that the automated
GPC Test Suite understands. Please, if at all possible, send your test
programs in this form which should be easy to do, so we won't have to
waste our time to bring them into this form, and can concentrate on
fixing the problem.

   * The file containing the main program _must_ have a name ending
     with `.pas' and contain the keyword `program' (case-insensitively)
     and a `;' in the same line to be recognized by the Test Suite at
     all. Other files whose name ends in `.pas' (e.g., units or modules
     needed by the program), must not contain this.

   * Since the Test Suite must run under very ... nah ... strange
     operating systems, too, file names must be distinguished in their
     first eight characters (case-insensitively) and should not contain
     anything but letters, numbers, hyphens, underscores and a single
     dot. Furthermore, any ancillary files (units, modules, includes,
     data files) should not be longer than "8+3" characters. It is
     often a good idea to use your name, nickname or initials followed
     by a number as the file name.

   * If your test program needs any units or modules, don't give them
     (or their interfaces in case of modules) common names like `Test',
     `Foo' or `MyUnit', unless you have very special reasons to,
     because there might be subtle problems if several test programs
     use the same name. Instead, it is recommended to prefix the
     unit/module/interface names with the name of the main test program
     or an abbreviation of it (if necessary because of the file name
     restrictions). Furthermore, please avoid the use of units and
     modules at all if the bug is not specific to them, in order to keep
     the test as simple as possible.

   * The test program, when run, should produce a line of output
     consisting of the string `OK' (followed by a newline) if
     everything went as expected, and something else (e.g. `failed',
     possibly followed by the reason of failure) if something went
     wrong.

   * However, if the program is intended to check whether GPC catches an
     (intentional) error in the program, place the string `WRONG'
     somewhere in the test program, preferably in a comment in the line
     that contains the intentional error, and make the program output
     `failed' or something like this if it does compile mistakenly.
     `WRONG' tests will be run with the option `-w' to suppress all
     warnings, so only real errors will be detected.

     *Note:* While it is possible to combine several `OK' tests in a
     single test program (if you make sure that it outputs `OK' only if
     all tests pass), you cannot put several `WRONG' tests into one
     test program. This is because the compiler will fail (and the test
     therefore be regarded as successful) already if _one_ error
     occurs. So, for `WRONG' tests, write only one check per test
     program. Also, try to keep such a test program as simple as
     possible, to avoid the risk that it will fail because of other
     problems (and therefore the test be mistakenly considered
     successful).

   * If the test should merely provoke a GPC warning, use `WARN'
     instead of `WRONG'. This will run the test without `-w', but with
     `-Werror'. However, such tests will also appear to succeed if they
     produce a compiler error, not only a warning.  Therefore, when
     checking for a warning, it is often a good idea to provide a
     complementary test (with expected success) and with `-w' in `FLAG'
     or a compiler directive `{$W-}' to make sure that it's really just
     a warning, not an error.


   The following special features of the Test Suite may be helpful for
constructing slightly unusual tests:

   * If the expected output is something else than `OK', place it in a
     file `<basename>.out' (where `<basename>' is the name of the test
     program without the `.pas' extension).

   * If the test program expects some input, place it in a file
     `<basename>.in'. It will automatically be redirected to the
     program's standard input.

   * If the test needs some special flags to be given to the GPC command
     line, place them in a comment preceded by `FLAG', e.g.:

          (* FLAG --extended-pascal -Werror *)

   * The source file name of the test program will be passed as the
     first command-line argument to the test program run.

   * If a test needs to be run in a special way, you can accompany the
     program with a script `<basename>.run' that will do the actual
     test after the test program was compiled. This script will be run
     by `sh' (regardless of its first line). In order to be portable,
     it should only use standard tools and features present in all `sh'
     compatible shells (e.g., `ash', `bash', but not necessarily
     `csh'). The source file name of the test program will be passed as
     the first command-line argument to the run script in this case.
     The compiled file is called `./a.out' on most systems, but, e.g.,
     `./a.exe' on Cygwin. The environment variable `A_OUT' contains the
     base name (i.e., `a.out' or `a.exe', so you can always invoke the
     program as `./"$A_OUT"').

   * If a test needs to be compiled in a special way (e.g., to decide
     whether to skip the test), place the commands in a script
     (preferably called `<basename>.cmp'), and put the file name of the
     script (without directory) in a comment preceded by `COMPILE-CMD:'
     into the source of the test program. The compile script will be
     run *instead* of the compiler and any other action otherwise done
     for this test program, so it gives you maximum flexibility to do
     whatever you need to do. This script will be run by `sh'
     (regardless of its first line). In order to be portable, it should
     only use standard tools and features present in all `sh'
     compatible shells (see above). The first command-line argument to
     the compile script will be the compiler to use, including all
     options. The second argument will be the source file name of the
     test program. For some typical tests, there are standard compile
     scripts, e.g. `ia32.cmp' which will skip the test unless run on an
     IA32 processor. This is necessary, e.g., when testing assembler
     code. Of course, it's still better to avoid having to use such
     scripts when possible.

   * In some cases you may want to write _randomized_ tests. This is
     not usually recommended since it makes problems found harder to
     reproduce, but sometimes it might be useful (e.g., if you want to
     cover a large parameter space). In such a case, the following
     strategy can be used:

          ...
          
          uses GPC;
          
          var
            RandomSeed: Integer;
          
          begin
            RandomSeed := Random (MaxInt);
            SeedRandom (RandomSeed);
          
            ... { do your normal tests }
          
            { when printing an error message: }
            if ... then
              begin
                WriteLn ('failed (', RandomSeed, ') ',
                         ... { possibly additional information } );
                Halt
              end
          end.

     This is a little unnatural since a random number is used to
     (re-)seed the random number generator, but there's currently no way
     to retrieve the internal state of the random number generator (and
     in fact, it's not represented by a single number, but by an array).

     Given the value of `RandomSeed' in an error message, it should
     then be possible to reproduce the problem by inserting this value
     in place of the `Random (MaxInt)'. Just be sure to print this
     value in *every* message of failure the program may produce.



File: gpc.info,  Node: Testing,  Prev: Reporting Bugs,  Up: Support

Running the GPC Test Suite
==========================

   _Note:_ If you have installed a GPC binary distribution, you usually
don't have the Test Suite installed (you can download the GPC source
distribution to get it, however), so this section does not apply to
you. Still, you can find in the section `Contributing Tests to the Test
Suite' how to report GPC bugs in the form of new test programs so we
can fix them as fast as possible.

   The files in the test directory and subdirectories are for testing
GPC only and should not be of any other use.

   Note: A few of the tests do not make sense on all systems. They are
equipped with checks and will be skipped if they find the system not
suitable. Skipped tests do *not* indicate a GPC bug, unless you have a
reason to be sure that the particular test should make sense on your
system.

   * To run the whole Test Suite, type `make' in the test directory (or
     `make check' in the `p' object directory after building GPC).

   * The output will show all errors encountered (hopefully none) and
     tests skipped, and finally display a summary giving the number of
     successful, failed and skipped tests. Any failed test indicates a
     bug in GPC which should be reported to the GPC mailing list,
     <gpc@gnu.de>. Don't forget to mention the operating system you ran
     the test on and any other relevant information about what you did.

   * You can also type `make pascal.check-long' to get a long output
     which is a sequence of file names followed by `OK' for successful
     tests, `SKIPPED' for skipped tests (both in capital letters), and
     anything else for failed tests.

   * To run only some of the tests, you can type something like `make
     MASK="foo[1-7]*.pas"' or `make MASK="foo42.pas" pascal.check-long'.

   * To clean up after running the tests, type `make clean'.



File: gpc.info,  Node: To Do,  Next: Internals,  Prev: Support,  Up: Top

The GNU Pascal To-Do List.
**************************

   This is the To-Do list for the GNU Pascal Compiler.

   The GNU Pascal development team is constantly working on making GNU
Pascal more reliable and more comfortable. However, there are some
known bugs which will take some time to be fixed (any help welcome!),
and we do not want to hide them from you. You might also be interested
to know what features are planned to be implemented in the future. This
list is meant to keep track of the known bugs and wanted features of
GPC.

   If you want to report a new bug or suggest a new feature, the best
way to do it is in the mailing list. This way, other GPC users can
provide additional ideas, perhaps work-arounds for bugs, and the GPC
maintainers can sooner start to think about how to solve the problem.
The GPC mailing list is <gpc@gnu.de>. To subscribe, send the command
`subscribe gpc your@email.address' in the body of a mail to
<majordomo@gnu.de> (the subject is ignored). An archive of the mailing
list can be found on `http://www.gnu-pascal.de/crystal/gpc/en/'.

   The list changes every few days. The present version refers to the
current GPC snapshot, 20020510.

   This list is part of the GNU Pascal Manual, included in GPC
distributions and snapshots. You can always browse the most current
version of the list on GPC's WWW page in HTML.  If you check the To-Do
list regularly you can decide if and when to try a new snapshort.

* Menu:

* Known Bugs::        Known bugs in GPC
* Planned Features::  Features planned for GPC
* Done::              Fixed bugs and implemented features


File: gpc.info,  Node: Known Bugs,  Next: Planned Features,  Up: To Do

Known bugs in GPC
=================

   In the following sections, you can find information about GPC bugs
that are known to the developers. The list always corresponds to the
latest developer versions of GPC, usually not to the latest official
distribution.

   If you encounter a bug with GPC, please check whether it is one of
the known bugs. If not, report it to the GNU Pascal mailing list.  (But
always report if you solve the problem! :-)

   Entries will be removed from the list as soon as the problem is
solved in the developers' current GPC version. (Exception: If we can't
reproduce the problem, but someone else can, the entry will be removed
when we hear from this person that the problem is solved.)  Problems
which are announced to be solved, but for which we (or the person who
can reproduce the problem) did not get the proof (i.e., a GPC source
patch) yet, are marked `(ok)'.

   A message ID (like `<42@foo.bar>') refers to a message in the GPC
mailing list (or a newsgroup, denoted with `news:') where the topic was
discussed (often a bug report). A note of the form `(xy20001231)'
refers to an internal message of the GPC developers. A file name like
`(foo42.pas)' refers to the according program in the GPC test suite
included in the GPC source distribution.

   * give a warning rather than an error (and nothing in
     `--borland-pascal') when assigning/passing by value an object of
     derived type to one of a base type (and change the VMT pointer in
     the destination/actual parameter), don't change the VMT pointer
     when assigning to a polymorphic object (chief35[ab].pas), don't
     allow value parameters of abstract types, handle value parameters
     like variables in `is'/`as'

   * possible stack overflow when using string concatenation in a loop,
     and problem with string concatenation and `goto' (contourbug.pas,
     martin1.pas, fjf419.pas)

   * `setlimit' is applied when it shouldn't be ((a) variable/constant
     declarations, (b) `set of ShortCard', (c) constant sets)

   * the capacity of strings declared in interfaces of modules is not
     initialized (daj3.pas, sven14c.pas)

   * (subrange) components of packed arrays should be packed as well
     (but not other types) (daj14[ab].pas)

   * initializers of packed arrays don't work (emil5.pas)

   * some functions in boolean shortcuts are always called
     (fjf226[a-\infty].pas)

   * arithmetic expressions don't work as lower array/subrange bounds
     (fjf248.pas)

   * global dynamic variables don't work (john1.pas)

   * check for using, incrementing, ... unused variables
     <199711270257.VAA06393@mint.mint.net> (kevin2.pas), especially for
     strings, also for `for'-loop counters after the loop (EP 6.8.1)
     and modifying `for'-loop counters within the loop or in local
     routines <200005240807.EAA05355@mail.bcpl.net>

   * types declared in a module interface are not visible in the
     implementation (kevin13.pas, mod12.pas)

   * declaring a procedure in the implementation with the same name as
     an imported procedure doesn't work (chief18.pas), detect name
     collisions between imported EP modules (mod9.pas)

   * packed array/record fields don't work in `Read' etc. (tom5.pas)

   * dynamic sets don't work (->PPS)

   * there are some bugs with mathematical functions; GPC fails, for
     example, the Paranoia test

   * the compiler does not always recover well after a parse error
     <199911040915.KAA11168@humulus.daimi.au.dk>

   * count of parameters in error messages should not include `Self' in
     methods or internal parameters for conformant/open arrays
     <8F990E3D9A6FD1118F3B0000F81EA1D84985CE@exchsa2.dsto.defence.gov.au>

   * bug on machines with strict alignment requirements
     <199906021618.MAA06228@sten27.software.mitel.com>

   * forward referencing pointers generate debug info that appears as
     generic pointers; no information of `with' statements is currently
     given to the debugger

   * check parameter names in repeated forward etc. declarations
     <20010321204051.A611@plato>

   * check that all routines declared in an interface are implemented
     in the corresponding implementation

   * the warnings about uninitialized/unused variables don't work for
     strings, sets, etc.

   * Sparc with gcc-2.95.x: `goto' jumping out of two procedure nesting
     levels doesn't work (GCC bug; fixed in 3.0.1)
     <200111170922.KAA09125@goedel.fjf.gnu.de> (fjf558[op].pas) (->
     `Trap' unit)

   * AIX: `ReturnAddress' doesn't work after use of dynmamic variables
     (GCC bug)

   * powerpc: `--strength-reduce' doesn't work with `for' loops (ok?)


File: gpc.info,  Node: Planned Features,  Next: Done,  Prev: Known Bugs,  Up: To Do

Features planned for GPC
========================

   In the following sections, you can find informations about features
which have been suggested and/or discussed for inclusion into GPC,
usually in the GPC mailing list. The division into the sections and the
names of the sections may change when this seems useful. The entries
within each section are in no particular order.

   Some of the entries may be a bit difficult to read. Double question
marks (`??') within the entries mean that it's not yet clear how to do
the thing. Triple question marks (`???') mean that it's not clear
whether to do it at all. ;-)

* Menu:

* Planned - Strings::            String types
* Planned - Records/arrays::     Record and array types
* Planned - Files::              Files
* Planned - Other types::        Other types
* Planned - Units and modules::  Units and modules
* Planned - OOP::                Object oriented programming extensions
* Planned - Misc::               Miscellaneous GPC topics
* Planned - Utilities::          Useful utilities for GPC


File: gpc.info,  Node: Planned - Strings,  Next: Planned - Records/arrays,  Up: Planned Features

Planned features: Strings
-------------------------

   * const/var `AnyString' parameters and pointers (records internally,
     cf. gpc.pas) (GetCapacity; only for var parameters)

   * `SetLength' for non-Pascal string types; use truncate-flag

   * make work on all string types: string functions from
     rts/gstrings.pas, Concat/+ (function with conformant array;
     Optimize `s := s + ch') (fh19971105)

   * new option `--arrays-of-char-as-cstrings={none,zero-based,all}' to
     allow assigning [zero-based] arrays of char to cstring variables
     (warning otherwise) (cstrini2.pas); make padding of those arrays
     in initialized variables and in assignments dependent on this
     switch (fh19970921) (fjf57.pas, ok) and if the length matches
     exactly, give a warning (fh19971013) (cstrassign.pas); pass those
     arrays as cstrings in read*, write*, str (P_*STRING; current
     length=-1 in two places); compile time warning (and treatment as
     non-zero-based) if it's not clear at compile time if a conformant
     array or schema is zero-based or not, and an operation depends on
     this in the zero-based state

   * Short strings (Length, Capacity) and switches
     (tc19980326.2,tc19980327); allow `type x=string' (undiscriminated)
     when switch is set so that strings don't default to length 255
     (fh19971113) (fjf97.pas, ok); don't add a #0 terminator when
     passing as a CString parameter (automatically use String2CString)

   * automatically convert CStrings to Strings?

   * general switch `--bp-strings'

   * offer trimming string relations as functions

   * `WriteStr'-like function

   * wide characters

   * open array/string parameters (`$P', `$V' in BP; undocumented
     `OpenString' identifier in BP)

   * variables of type undiscriminated schema/strings -> remove
     pointers to string constants; functions returning undiscriminated
     schemata (pg19980813.3)


File: gpc.info,  Node: Planned - Records/arrays,  Next: Planned - Files,  Prev: Planned - Strings,  Up: Planned Features

Planned features: Records/arrays
--------------------------------

   * array/record values/initializers: recognize indices and field
     names (sven4.pas), ISO structured constants (constdef.pas);
     variant records <C1256791.0021F002.00@synln01.synstar.de>; allow
     omitting fields; fields in arbitrary order ???; index/field name
     optional; arrays: warning/error when too few fields are given;
     initialized schemata; <200106170346.f5H3ksj22229@mail.bcpl.net>

   * initialized types in records/arrays (inirec[24].pas)

   * when applying `New' to a variant record type with a selector
     given, only allocate the space necessary for the selected variant
     (varrec2.pas) ???

   * Oregon and Vax Pascal structured constants
     <80256540.005E7D08.00@buffer1.quantel.com> ???

   * automatically detected upper array bounds in structured
     constants/intialized variables (-> PXSC)

   * simplify code generated to compute size of dynamical variables if
     no bitfields are involved

   * tagging feature for `with' statements (Sun Pascal) (tom6.pas)
     <200012022215.eB2MFD614424@wsinpa16.win.tue.nl>

   * transpose arrays (Fortran)? <news:918557$mke$1@nnrp1.deja.com>


File: gpc.info,  Node: Planned - Files,  Next: Planned - Other types,  Prev: Planned - Records/arrays,  Up: Planned Features

Planned features: Files
-----------------------

   * `AnyFile' parameters and pointers

   * keep files in FDRList while they live, not only while they're
     open, so `_p_fdrdone' can be applied to all of them

   * packed files (EP) ??

   * `FormatString': left/center/both(?) justification (ok in RTS,
     NEG_WIDTH_LEFT_MASK etc.); rounding (PXSC) ???

   * improve TFDDs (also for typed and untyped files)
     (OpenProc/CloseProc)

   * read/write operators ???

   * let `Assign' call `_p_initfdr' in `--borland-pascal'


File: gpc.info,  Node: Planned - Other types,  Next: Planned - Units and modules,  Prev: Planned - Files,  Up: Planned Features

Planned features: Other types
-----------------------------

   * UCSD Pascal's `Integer[n]' ??? BCD?

   * enum types with specified values ???; Inc, Pred, ... ??

   * enum type extensions (syntax??)

   * check for dereferencing nil pointers

   * general subtypes ???

   * type cast operators ???

   * make `SizeOf' work on specially declared untyped var and const
     parameters (`AnyType'?)

   * sparse sets; sets of arbitrary types ?? ???

   * optimize set constructors even better ???

   * superfluous warning with sets and variable elements (fh19970928)

   * initalization and finalization code for arbitrary types (e.g. GMP
     types)

   * give an error rather than a warning when casting between types of
     different size in {$X-}

   * storage class qualifiers (`external', `asmname', `static',
     `volatile', `attribute')

   * `SELECTED_REAL_KIND' for real types (cf. Fortran, drf) ?? ???

   * resize schemata (cf. `SetLength' in Delphi)

   * subranges with variable limits (couper[23].pas)


File: gpc.info,  Node: Planned - Units and modules,  Next: Planned - OOP,  Prev: Planned - Other types,  Up: Planned Features

Planned features: Units and modules
-----------------------------------

   * qualified identifiers <34508F33.4F685BD1@keele.ac.uk> (also
     `program_name.identifier'?) (problem module.id vs. record.field);
     also for operators; `gpc' for built-in identifiers; duplicate
     identifiers in different units (fjf260[ab].pas); giving the same
     name to a routine in an interface and a local routine doesn't work
     (fjf240.pas); don't capitalize variable names in error messages
     and file name queries (store the casing of the first occurrence of
     an identifier) -> remove `{$no-debug-info}'

   * `external name', `asmname', ...; (-> BP, Delphi) ??, like `$L'
     (fh19990325.2)

   * modules without implementation ??? (pmod1.pas)

   * `asmname' for units

   * qualified import (mod10.pas)

   * inline functions in GPI files

   * unit inheritance (of a complete interface with one statement or
     selectively)
     <Pine.HPP.3.96.971105161603.28577A-100000@tea.geophysik.tu-freiberg.de>,
     <199711061008.LAA25341@agnes.dida.physik.uni-essen.de> ??; virtual
     procedures ???

   * allow accessing non-exported identifiers in the implementation of
     a module
     <Pine.BSI.3.96.971110210330.7570A-100000@malasada.lava.net>

   * `Initialization/Finalization' (Delphi: =`to begin/end do') (???)
     (only in `--delphi'?)


File: gpc.info,  Node: Planned - OOP,  Next: Planned - Misc,  Prev: Planned - Units and modules,  Up: Planned Features

Planned features: OOP
---------------------

   * init VMT in initialized variables (fjf445*.pas)

   * `published', `public', `protected', `private' (scope limited to a
     unit in `--borland-pascal', and to the object type normally)

   * `ProcVar := Obj.Method' {$X+}; method pointers
     (`procedure/function of object') (-> Delphi) ???

   * VMT link (global, local, new: set to 0 or @VMT; destructor: reset
     to 0)

   * checks: `@Obj <> nil', `TypeOf (Obj) <> nil', `TypeOf (Obj)^.Size
     = -TypeOf (Obj)^.NegatedSize'; separate switches; function
     initialized (that does these 3 tests) ???

   * virtual constructors

   * `CLASS is CLASS' (implemented in Pascal with `Parent')

   * interfaces (cf. OOE, Java); `OBJ is INTERFACE' (not so easy?) ???;
     variables of type pointer to more than one interface [and class]
     (also possible!)

   * allow method-implementation right after the declaration ???

   * friends ???

   * `dynamic' (= `virtual' ?)

   * `class' (reference to an object type); allow classes and object
     types to inherit from each other; OOE;
     <01BD7A3A.6B187A20.prucha@helicon.co.at>; obpascal.zip

   * `New': Delphi syntax; Dispose?? (automatically?; set references
     automatically to nil) (-> FPC)

   * `--base-class=foo', `--base-object=bar' ???

   * properties <01BD7A3A.6B187A20.prucha@helicon.co.at>,
     <16131.199805071354@potter.cc.keele.ac.uk>

   * virtual constructors in interfaces (load)???

   * VMT problem with interfaces (my solution??? also with dynamic
     linking???)

   * VMTs (also for local classes (EP modules???)!) in GPI files,
     written to assembler file by main program; `--cfiles=foo': .s file
     with VMTs for C/assembler??? (also .h???)

   * method overloading ??? ??

   * class libraries (more or less TV compatible?/Free Vision/EFLIB)
     (streams as interface type?)

   * VMT: ClassID (64/128 bits?) default 0, error when duplicated,
     warning when 0 and inherited from class with <>0 ?, not allowed
     for abstract classes!; ClassName (also for abstract classes?); [];
     ProgrammerID, BaseClassID at beginning of unit (redeclarable?) ???

   * VMT: Children: list of pVMT

   * find class by ClassID/ClassName (implementable in Pascal with
     `Child')

   * object constants, class variables (-> other name for `VMT');
     virtual/static

   * store in GPI: whether ClassID used, ClassName used, which classes
     are instantiated

   * `asmname' for methods


File: gpc.info,  Node: Planned - Misc,  Next: Planned - Utilities,  Prev: Planned - OOP,  Up: Planned Features

Planned features: Misc
----------------------

   * read Booleans and enum types from files, write enum types to
     files; `--[no-]read-range-checking' (also for subtypes of Char,
     Boolean and enum types!)

   * make it possible to declare routines as `iocritical' and
     `ignorable'

   * switch to warn about everything that could cause portability
     problems

   * document all compiler options and switches; make `gpc --help'
     output all the options ???

   * libraries (static/shared; DLL)
     <Pine.HPP.3.96.971110183550.7996B-100000@tea.geophysik.tu-freiberg.de>

   * smart linking

   * range
     <Pine.LNX.4.21.0012091605570.8168-100000@rusty.russwhit.com>,
     overflow (right operand of mod <=0 is an error), nil pointer,
     string length, object VMT (pointer, negative size field), etc.
     checking <199911040915.KAA11168@humulus.daimi.au.dk>; also for
     array slice access (miklos1.pas); check that strings converted to
     CStrings don't contain #0 characters; initialize strings (length
     field), pointers, ordinal values and reals(?) with invalid values
     if checking is on

   * overloading of unary operators

   * intel assembler syntax; BP BASM ???

   * function overloading (in units and static methods?? - with
     different parameters, override or overload?); asmname?? (perhaps:
     first occurrence of a procedure with normal asmname (=> all
     non-overloaded procedures get normal asmnames)?); cf. Delphi
     methods without `override'

   * and_else, or_then (names??); guarantee complete evaluation in
     `{$B+}' mode

   * `?:' (`x := if c then bar else baz')

   * C operators (`,', `=', `++'/`--' (pre/post), `+=', ...), as
     functions ?

   * `for var: type = foo to bar do' ???

   * error/exception handling (Java,Delphi?)
     <01BD7A3A.6B187A20.prucha@helicon.co.at> (tc20000623)

   * RTS checking (libgpc_g), switch?

   * simplify math functions
     <199708091006.MAA26576@agnes.dida.physik.uni-essen.de>

   * variable number of arguments <32F9CFE7.5CB@lmemw.ericsson.se> ??
     ???

   * multithreading support ?? ???

   * `--wirth-pascal' :-)

   * PXSC standard ... (`pxsc.zip', `contrib/peter/pxsc') (??)

   * Object Oriented Extensions (Technical Report) (??)

   * generic types (cf. OOE section C.1) (gentypes.pas) ???

   * default parameters (cf. OOE section C.4; Delphi 4?)
     (iniparm[12].pas)

   * Pascal++ standard ... (??) ???

   * allow `procedure foo; inline;'

   * compile time assertions ???

   * Ignore{Value,Result}/Discard and Swap for arbitrary types

   * make operators also available as functions

   * `absolute' with automatic type detection; `absolute' procedures
     (with automatic parameter detection) ???

   * Delphi features: CompToCurrency, CurrencyToComp, Slice, TypeInfo
     ???, dynamic arrays (tc19991012); Assert (tc20010225.2)

   * output column numbers in error messages ??

   * warn when `and' and `or' are combined without parentheses
     (-Wparentheses; on by default)

   * assembler blocks should be considered volatile by default ???
     (fh19980829.4)


File: gpc.info,  Node: Planned - Utilities,  Prev: Planned - Misc,  Up: Planned Features

Planned features: Utilities
---------------------------

   * `gp' make utility to replace automake; compile and link programs,
     but compile units without linking and without a warning that there
     is nothing to link; store GPC version numbers, platform and
     options in GPD files and re-compile automatically in `--automake'
     mode when they don't match

   * C header to Pascal translator

   * gdb: Pascal types (sets, files, subranges, schemata, strings, ...)

   * `indent'-like source code formatter for Pascal

   * AT&T <-> Intel assembler syntax converter ???


File: gpc.info,  Node: Done,  Prev: Planned Features,  Up: To Do

Fixed bugs and implemented features
===================================

* Menu:

* Fixed Bugs::            Problems that have been solved
* Implemented Features::  Features that have been implemented

