Switches for gnatprep (GNAT User’s Guide for Native Platforms)

#### 3.10.2.3 Switches for `gnatprep` ¶

`--version`

  Display copyright and version, then exit, disregarding all other options.

`--help`

  If `--version` was not used, display usage and then exit, disregarding all other options.

`-b`

  Causes both preprocessor lines and the lines deleted by preprocessing to be replaced by blank lines in the output source file, preserving line numbers in the output file.

`-c`

  Causes both preprocessor lines and the lines deleted by preprocessing to be retained in the output source as comments marked with the special string `"--! "`. This option also results in line numbers being preserved in the output file.

`-C`

  Causes comments to be scanned. Normally comments are ignored by `gnatprep`. If you specify this option, `gnatprep` scans comments and any $symbol substitutions performed as in program text. You will find this particularly useful when structured comments are used (e.g., for programs written in a pre-2014 version of the SPARK Ada subset). This switch is not available when doing integrated preprocessing (it would be useless in this context since comments are always ignored by the compiler).

`-D`symbol'[=`value']`

  Defines a new preprocessing symbol with the specified value. If you don’t specify a value, the symbol is defined to be `True`. You can use this switch instead of providing a definition file.

`-e`

  Causes both preprocessor lines and the lines deleted by preprocessing to be replaced by empty comment lines marked with `"--!"` (and no other text) in the output source file, preserving line numbers in the output file. This option can be useful as an alternative to `-b` and `-c` when compilation style switches like `-gnatyu` or `-gnatyM` are used (to avoid warnings about multiple blank lines or lines too long).

`-r`

  Causes `gnatprep` to generate a `Source_Reference` pragma that references the original input file, so that error messages will use the file name of this original file. The use of this switch implies that preprocessor lines are not to be removed from the file, so the `-b` and `-c` are always enabled.

  If the file to be preprocessed contains multiple units, you must call `gnatchop` on the the output file from `gnatprep`. If a `Source_Reference` pragma is present in the preprocessed file, it will be respected by `gnatchop -r` so that the final chopped files will correctly refer to the original input source file passed to `gnatprep`.

`-s`

  Causes a sorted list of symbol names and values to be listed on the standard output file.

`-T`

  Use LF as line terminators when writing files. By default the line terminator of the host (LF under unix, CR/LF under Windows) is used.

`-u`

  Causes undefined symbols to be treated as having the value `False` in the context of a preprocessor test. If you don’t specify this switch, `gnatprep` will treat an undefined symbol in a `#if` or `#elsif` test as an error.

`-v`

  Verbose mode: generates more output about what is done.

Note: if you don’t specify either `-b` or `-c`, then preprocessor lines and deleted lines are completely removed from the output, unless you specify `-r`, in which case `gnatprep` enables the `-b` switch.