[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 3.2 Command Line Options and Compiler Directives

(Here are GPC's new options. For an overview of the options, see section 7. Command Line Options supported by GNU Pascal..)

- ``-x Pascal'`/``--language=Pascal'` works now; new option ``-x Preprocessed-Pascal'`/``--language=Preprocessed-Pascal'` to compile without preprocessing

- ``{$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-]implicit-abstract'` (warn if an object type not declared ``abstract'` contains an abstract method)

- ``-W[no-]inherited-abstract'` (warn if an abstract object type inherits from a non-abstract one)

- ``-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-]semicolon'` (warn about a semicolon after ``then'`, ``else'` or ``do'`)

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

- ``-W[no-]object-directives'` (don't warn about unimplemented ``private'`, ``protected'` and ``public'` directives)

- ``-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-]read-base-specifier'` (in read statements, allow non-decimal input with ``n#'`)

- ``--[no-]read-hex'` (in read statements, allow hexadecimal input with ``$'`)

- ``--[no-]read-white-space'` (in read statements, require whitespace after numbers)

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

- ``--[no-]double-quoted-strings'`

- ``--[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)

- ``--init-modules=foo:bar'` (initialize the named modules in addition to those imported regularly; kind of a kludge)

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

- ``--big-endian'`, ``--little-endian'`, ``--print-needed-options'` for targets whose endianness can vary

- 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. (@)

- The items of ``--field-widths'` are now delimited by `:' rather than `,' so they can be distinguished from the `,' used to delimit several compiler options. (@)

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

- New options ``--classic-pascal'` and ``--classic-pascal-level-1'` (equivalent to ``--standard-pascal'` and ``--standard-pascal-level-1'`, and meaning to supersede the latter in the future)

- New predefined symbol ``__GPC_VERSION__'`

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by Frank Heckenbach on May, 10 2002 using texi2html