tdfc2, tcpplus — DRA C/C++ to TDF producers



[ -s spec-file.k/.kk ]
[ -- ] [ input-file.c/.cc… ] [ output-file.j ]


[ -E ]
[ -- ] [ input-file.c/.cc… ] [ output-file.i ]


[ -S ] [ -s spec-file.k/.kk ]
[ -- ] [ input-file.k/.kk… ] [ output-file.j ]


{ -h | -v }

Most options are common to all modes. For brevity, these are not repeated above:


[ -A predicate(tokens) ] [ -C file ] [ -D macro ] [ -D macro=tokens ] [ -F file ]
[ -H ] [ -I dir ] [ -N name:dir ] [ -U macro ] [ -V ] [ -W opt ] [ -X ] [ -Z num ]
[ -a ] [ -c ] [ -d opt=dump-file ] [ -e file ] [ -f file ] [ -g ] [ -i name ] [ -j opt ] [ -m opt ]
[ -n port-table ] [ -o output-file ] [ -q ] [ -t ] [ -u name …  name ] [ -w ] [ -z ]


tdfc2 and tcpplus have three modes which determine the form of their input and output files.

The default mode is compilation, in which an input source file, input-file.c/.cc, is translated into a TDF capsule, output-file.j. tdfc2 translates C source, and tcpplus translates C++ source. The output file can alternatively be specified using the -o option. If the output file name is omitted or is -, standard output is used. In general there can be any number of input files. If the input file name is omitted or is -, standard input is used.

In preprocessing mode, specified using the -E option, the single input source file, input-file.c/.cc, is preprocessed to an output file, output-file.j. Note that the preprocessor is built into tdfc2 and tcpplus, rather than, as with most other compilers, being a separate program.

The final mode is spec linking, invoked using the -S option, in which any number of spec input files, input-file.k/.kk, are linked and any code generated as a result (for example, template instantiations) is written to the output TDF capsule, output-file.j.

In either compilation or spec linking mode, a spec file can be generated in addition to the TDF capsule, using the -s option. The generated spec file contains information enabling intermodule analysis to be performed.

In any mode a tdfc2dump symbol table dump output file can be generated using the -d option. This outputs usage and error information suitable for processing by other tools, output as a symbol table dump file. See tdfc2dump for the dump file format.


While it is possible to use tdfc2 and tcpplus as stand-alone programs, it is recommended that they should be invoked via tcc or tcc -ch. The TCC Users' Guide should be consulted for more details.

The command-line options can appear in any order and can be interspersed with the input and output files, except following a -- option.. All the multi-part options can be given either as one or two command-line arguments, so that -Idir and -I dir are equivalent.

Most of the command-line option handling for tdfc2 and tcpplus is done by tcc and tcc -ch, however when invoking tcc, options may be passed directly to tdfc2 using -Wc,opt and to tcpplus using -Wx,opt. Similarly -Wg,opt and -WS,opt can be used to pass options to the C++ preprocessor and the C++ spec linker (both of which are actually tdfc2 or tcpplus invoked with different options) respectively.

tcc requires the -Yc++ command-line option in order to enable C++ capabilities. Files with a .C suffix are recognised as C++ source files and passed to tcpplus for processing It is possible to change the suffix used for C++ source files; for example -sC:cc causes .cc files to be recognised as C++ source files. An interesting variation is -sC:c which causes C source files to be processed by the C++ producer. Similarly .I files are recognised as preprocessed C++ source files and .K files are recognised as C++ spec files.


-A predicate(tokens)

Asserts that the given predicate is true. That is to say:

#assert predicate ( tokens )

The special case -A- undefines all the built-in predicates (of which there are none). Use of this option automatically enables support for the tdfc2pragma #assert and #unassert directives.

-C file

Load the given file as as a character set map. See tdfc2charset for the syntax of this file.

-D macro
-D macro=tokens

Defines the given macro to be 1 in the first case, or the given sequence of preprocessing tokens in the second case. That is to say, respectively:

#define macro 1
#define macro tokens

In fact -D and -U options to tcc are not passed as -D and -U options to tdfc2 or tcpplus. Instead a start-up file containing the equivalent #define and #undef directives is used.


Enables preprocessing mode in which the input C source file is preprocessed into the output file.

-F file

Causes a list of options to be read from file. Other than empty lines and lines beginning with #, each line in the file is treated as if it had been specified as a separate command-line option.


Enables verbose inclusion mode in which warnings are printed at the start and the end of each included source file.

-I dir

Adds the given directory to the list searched for included source files. No such directories are built in.

-N name:dir

Is identical to -I dirdir except that it also associates the given identifier with the directory. The directory name can be used to specify a tdfc2pragma compilation profile to be used on files included from this directory.


Enables spec linker mode in which any number of input spec files are linked into a single output spec file.

-U macro

Undefines the given macro.

The special case -U- undefines all the built-in macros. These are the standard macros __FILE__, __LINE__, __TIME__, __DATE__, __STDC__ and __STDC_VERSION__, and also __cplusplus for tcpplus only. Additionally, the macro __tcpplus is undefined; by default this is 0 for tdfc2 and 1 for tcpplus.

The actual value of __cplusplus gives the date of the draft ISO C++ standard on which the current version of the producer is based. The value given above gives the expected date of the final C++ standard.


Print the name of each function to standard output as it is compiled.

-W opt

Give a warning in the circumstances described by opt. This sets the given compiler option thus:

#pragma TenDRA option "opt" warning

The special case -Wall enables a wide range of warnings.


Disables exception handling. The current implementation can be a large run-time overhead if not required. The effect of linking any module compiled with this option with a module which throws an exception is undefined. This is equivalent to -j-e.

-Z num

Sets the maximum number of errors printed before bailing out to be num. The default is 32.


Apply complete program analysis to input files. That is, assume that no other translation units need to be linked in order for the program to execute.


Disables TDF output. The output file will still be a valid TDF capsule, only it will contain no information. This is equivalent to -j-c.

-d opt=dump-file

Dump information about the input source file into dump-file. opt is a set of characters describing the information to be dumped, as follows:

a (all)equivalent to ehlmu
cdump string and character literals
edump error messages
hdump header information
kdump keyword identifiers
ldump local variables
mdump macro identifiers
sdump scope information
udump identifier usage information

These correspond to the tcc -sym options.

-e file
-f file

Specifies the given file as a start-up or end-up file respectivelyfile. This is equivalent to adding:

#include "file"

at the start or end of the input source file.

More than one start-up and end-up file may be given; they are processed in the order given.


Specifies that the output TDF capsule should also contain information to allow for the generation of run-time debugging directives. This is equivalent to -jg.


Causes tdfc2 to print a full list of its available command-line options. This includes a number not documented here which are unlikely to prove useful to the normal user.

-i name

Specifies the machine name for use in diagnostics. This is the hostname of the machine where the source files are to be found, given from the perspective of a debugger inspecting objects produced from those files.

The machine name defaults to the empty string, meaning the same machine as the debugger.

-j opt

Sets the TDF output options given by opt. This consists of a sequence of characters describing the options to be enabled or disabled. The available options are:

+enable subsequent options (default)
-disable subsequent options
aoffoutput external names for local objects
boffwork around old installer bugs
conoutput TDF capsule
doffoutput termination function
eonoutput exceptions
fonmangle template function signatures
goffoutput debugging information
ioffoutput dynamic initialisers as a function
nonmangle object names
oofforder class data members by access
ponoutput partial destructors
ronoutput run-time type information
sonoutput shared string literals
toffoutput token declarations
uonoutput unused static variables
voffoutput local virtual function tables
-m opt

Sets the error formatting options given by opt. This consists of a sequence of characters describing the options to be enabled or disabled. The available options are:

+enable subsequent options (default)
-disable subsequent options
coffshow source code with error
eoffshow error name
goffrecord statement locations
koffenable C++ spec output
loffoutput full error location
sonoutput ISO section number
toffuse typedef names in errors
woffdisable warnings
zoffcontinue after error
-n port-table

Specifies that the given portability table should be used to specify the basic configuration parameters.

-o output-file

An alternative method of specifying the output file.


Quit immediately without processing input files. This is useful primarily in version and command line queries.

-s spec-file.k/.kk

Write a spec file describing the input source file to spec-file.


Include token declarations in the output TDF capsule. While these are strictly unnecessary, they help when pretty-printing the output. This is equivalent to -jt.

-u name …  name

Print the unmangled forms of the given mangled identifier names. The form:

tcpplus -u name .... name

can be used to print the unmangled forms of a list of mangled identifier names to standard output.


Print the producer version number to standard error, along with the versions of the source language and TDF supported.


Disables all warning messages. This is equivalent to -mw.


Forces tdfc2 and tcpplus to produce an output file even if compilation errors occur. The effect of installing a TDF capsule produced using this option is undefined. This is equivalent to -mz.


Marks the last option. Any subsequent arguments are interpreted as input and output files even if they resemble command-line options.

See Also

tcc, tdfc2dump, tdfc2pragma, tdfc2charset.

TCC Users' Guide.