This chapter contains the following sections:
Invocation
Detailed Description of the Compiler Options
Include Files
Pragmas
Compiler Limits
The invocation syntax of the C++ compiler is:
When you use a UNIX shell (Bourne shell,
C-shell), arguments containing special characters (such as '( )' and '?') must be enclosed
with " " or escaped. The -? option (in the C-shell) becomes:
"-?" or -\?.
The C++ compiler accepts a C++ source file name and command line options in random order. A C++ source file must have a .cc, .cxx or .cpp suffix.
Command line options may be specified using either single character option codes (e.g., -o), or keyword options (e.g., --output). A single character option specification consists of a hyphen '-' followed by one or more option characters (e.g., -Ab). If an option requires an argument, the argument may immediately follow the option letter, or may be separated from the option letter by white space. A keyword option specification consists of two hyphens followed by the option keyword (e.g., --strict). Keyword options may be abbreviated by specifying as many of the leading characters of the option name as are needed to uniquely identify an option name (for example, the --wchar_t-keyword option may be abbreviated as --wc). Note that this is not supported by the control program! If an option requires an argument, the argument may be separated from the keyword by white space, or the keyword may be immediately followed by =option. When the second form is used there may not be any white space on either side of the equals sign.
The priority of the options is left-to-right: when two options conflict, the first (most left) one takes effect. The -D and -U options are not considered conflicting options, so they are processed left-to-right for each source file. You can overrule the default output file name with the --gen-c-file-name option.
A summary of the options is given below. The next section describes the options in more detail.
Option | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-? | Display invocation syntax | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--alternative-tokens --no-alternative-tokens |
Enable or disable recognition of alternative tokens | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--anachronisms --no-anachronisms |
Enable or disable anachronisms | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--arg-dep-lookup --no-arg-dep-lookup |
Perform argument dependent lookup of unqualified function names | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--array-new-and-delete --no-array-new-and-delete |
Enable or disable support for array new and delete | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--auto-instantiation --no-auto-instantiation -T |
Enable or disable automatic instantiation of templates | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--base-assign-op-is-default --no-base-assign-op-is-default |
Enable or disable the anachronism of accepting a copy assignment operator with a base class as a default for the derived class | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
--bool --no-bool |
Enable or disable recognition of bool
--brief-diagnostics | --no-brief-diagnostics
| Enable or disable a shorter form of diagnostic output
--cfront-2.1 | -b
| Compile C++ compatible with cfront version 2.1
--cfront-3.0 |
Compile C++ compatible with cfront version 3.0 |
--class-name-injection | --no-class-name-injection
| Add class name to the scope of the class
--comments | -C
| Keep comments in the preprocessed output
-Ccpu |
Include SFR definition file regcpu.sfr before source |
--const-string-literals | --no-const-string-literals
| Make string literals const
--create-pch file |
Create a precompiled header file with the specified name |
--define macro[(
parm-list)] [=def] | -Dmacro [(parm-list)][=def]
| Define preprocessor macro
--dependencies | -M
| Preprocess only. Emit dependencies for make
--diag-suppress tag[,tag]... | --diag-remark tag[,tag]... --diag-warning tag[,tag]... --diag-error tag[,tag]...
| Override normal error severity
--display-error-number |
Display error number in diagnostic messages |
--distinct-template-signatures | --no-distinct-template-signatures
| Disallow or allow normal functions as template instantiation
--dollar | -$
| Accept dollar signs in identifiers
--early-tiebreaker |
Early handling of tie-breakers in overload resolution |
--embedded | --no-embedded
| Enable or disable support for embedded C++ language extension keywords
--embedded-c++ |
Enable the diagnostics of noncompliance with the "Embedded C++" subset |
--enum-overloading | --no-enum-overloading
| Enable or disable operator functions to overload builtin operators on enum-typed operands
--error-limit number
| -enumber
| Specify maximum number of errors
--error-output efile |
Send diagnostics to error list file |
--exceptions | --no-exceptions -x
| Enable or disable support for exception handling
--explicit | --no-explicit
| Enable or disable support for the explicit specifier on constructor declarations
--extended-variadic-macros | --no-extended-variadic-macros
| Allow (or disallow) macros with a variable number of arguments and allow the naming of the list
--extern-inline | --no-extern-inline
| Enable or disable inline function with external C++ linkage
-F |
Single precision floating point |
--force-vtbl |
Force definition of virtual function tables |
--for-init-diff-warning | --no-for-init-diff-warning
| Enable or disable warning when old-style for-scoping is used
--friend-injection | --no-friend-injection
| Control the visibility of friend declarations
--gen-c-file-name file |
Specify name of generated C output file
|
--guiding-decls | --no-guiding-decls
| Enable or disable recognition of "guiding declarations" of template functions
--implicit-extern-c-type-conversion | --no-implicit-extern-c-type-conversion
|
Enable or disable implicit type conversion between external C and C++ function pointers |
--implicit-include | --no-implicit-include -B
| Enable or disable implicit inclusion of source files as a method of finding definitions of template entities to be instantiated
--implicit-typename | --no-implicit-typename
| Enable or disable implicit determination, from context, whether a template parameter dependent name is a type or nontype
--incl-suffixes suffixes |
Set the valid suffixes for include files |
--include-directory dir | -Idir
| Look in directory dir for include files
--include-file file |
Include file at the beginning of the compilation |
--inlining | --no-inlining
| Enable or disable minimal inlining of function calls
--instantiate mode
| -t mode
| Control instantiation of external template entities
--instantiation-dir dir |
Write instantiation files to dir |
--late-tiebreaker |
Late handling of tie-breakers in overload resolution |
--list-file lfile
| -L lfile
| Generate raw list file lfile
--long-lifetime-temps | --short-lifetime-temps
| Select lifetime for temporaries
--long-preserving-rules | --no-long-preserving-rules
| Enable or disable K&R arithmetic conversion rules for longs
--namespaces | --no-namespaces
| Enable or disable the support for namespaces
--new-for-init |
New-style for-scoping rules |
--no-code-gen | -n
| Do syntax checking only
--no-line-commands | -P
| Preprocess only. Remove line control information and comments
--nonconst-ref-anachronism | --no-nonconst-ref-anachronism
| Enable or disable the anachronism of allowing a reference to nonconst to bind to a class rvalue of the right type
--nonstd-qualifier-deduction | --no-nonstd-qualifier-deduction
| Use (or do not use) a non-standard template argument deduction method
--nonstd-using-decl | --no-nonstd-using-decl
| Allow or disallow unqualified name in non-member using declaration
--no-preproc-only |
Specify that a full compilation should be done (not just preprocessing) |
--no-use-before-set-warnings | -j
| Suppress warnings on local automatic variables that are used before their values are set
--no-warnings | -w
| Suppress all warning messages
--old-for-init |
Old-style for-scoping rules |
--old-line-commands |
Put out line control information in the form # nnn instead of #line nnn |
--old-specializations | --no-old-specializations
| Enable or disable old-style template specialization
--old-style-preprocessing |
Forces pcc style preprocessing |
--one-instantiation-per-object |
Create separate instantiation files |
--output file | -o file
| Specify name of preprocess or intermediate output file
--pch |
Automatically use and/or create a precompiled header file |
--pch-dir dir |
Specify directory dir in which to search for and/or create a precompiled header file |
--pch-messages | --no-pch-messages
| Enable or disable the display of a message indicating that a precompiled header file was created or used in the current compilation
--pch-verbose |
Generate a message when a precompiled header file cannot be used |
--pending-instantiations n |
Maximum number of instantiations for a single template (default 64) |
--preprocess | -E
| Preprocess only. Keep line control information and remove comments
--remarks | -r
| Issue remarks
--remove-unneeded-entities | --no-remove-unneeded-entities
| Enable or disable the removal of unneeded entities from the generated intermediate C file
--rtti | --no-rtti
| Enable or disable support for RTTI (run-time type information)
--signed-chars | -s
| Treat all 'char' variables as signed
--special-subscript-cost | --no-special-subscript-cost
| Enable or disable a special nonstandard weighting of the conversion to the integral operand of the [] operator in overload resolution.
--strict | -A
| Strict ANSI C++. Issue errors on non-ANSI features
--strict-warnings | -a
| Strict ANSI C++. Issue warnings on non-ANSI features
--suppress-typeinfo-vars |
Suppress type info variables in generated C |
--suppress-vtbl |
Suppress definition of virtual function tables |
--sys-include dir |
Look in directory dir for system include files |
--timing | -#
| Generate compilation timing information
--trace-includes | -H
| Preprocess only. Generate list of included files
--tsw-diagnostics | --no-tsw-diagnostics
| Enable or disable TASKING style diagnostic messages
--typename | --no-typename
| Enable or disable recognition of typename
--undefine macro | -Umacro
| Remove preprocessor macro
--unsigned-chars | -u
| Treat all 'char' variables as unsigned
--use-pch file |
Use a precompiled header file of the specified name |
--using-std | --no-using-std
| Enable or disable implicit use of the std namespace when standard header files are included
--variadic-macros | --no-variadic-macros
| Allow (or disallow) macros with a variable number of arguments
--version | -V -v
| Display version header only
--warnings-as-errors |
Treat warnings as errors |
--wchar_t-keyword | --no-wchar_t-keyword
| Enable or disable recognition of wchar_t as a keyword
--wrap-diagnostics | --no-wrap-diagnostics
| Enable or disable wrapping of diagnostic messages
--xref xfile | -X xfile
| Generate cross-reference file xfile |
Table 4-1: Compiler options (alphabetical)
Description | Option | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Include options | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Include SFR definition file regcpu.sfr before source |
-Ccpu
Look in dir for include files |
--include-directory dir | -Idir
Look in dir for system include files |
--sys-include dir |
Set the valid suffixes for include files |
--incl-suffixes suffixes |
Include file at the beginning of the compilation |
--include-file file |
Preprocess options |
|
Preprocess only. Keep line control information and remove comments |
--preprocess | -E
Preprocess only. Remove line control information and comments |
--no-line-commands | -P
Keep comments in the preprocessed output |
--comments | -C
Do syntax checking only |
--no-code-gen | -n
Specify that a full compilation should be done (not just preprocessing) |
--no-preproc-only |
Put out line control information in the form # nnn instead of #line nnn |
--old-line-commands |
Forces pcc style preprocessing |
--old-style-preprocessing
|
Preprocess only. Emit dependencies for make |
--dependencies | -M
Preprocess only. Generate list of included files |
--trace-includes | -H
Define preprocessor macro |
--define macro[(
parm-list)] [=def] | -Dmacro [(parm-list)][=def]
Remove preprocessor macro |
--undefine macro | -Umacro
Allow (or disallow) macros with a variable number of arguments |
--variadic-macros | --no-variadic-macros
Allow (or disallow) macros with a variable number of arguments and allow the naming of the list |
--extended-variadic-macros | --no-extended-variadic-macros
Language control options |
|
Strict ANSI C++. Issue errors on non-ANSI features |
--strict | -A
Strict ANSI C++. Issue warnings on non-ANSI features |
--strict-warnings | -a
Single precision floating point |
-F |
Compile C++ compatible with cfront version 2.1 |
--cfront-2.1 | -b
Compile C++ compatible with cfront version 3.0 |
--cfront-3.0 |
Accept dollar signs in identifiers |
--dollar | -$
Treat all 'char' variables as signed |
--signed-chars | -s
Treat all 'char' variables as unsigned |
--unsigned-chars | -u
Enable or disable K&R arithmetic conversion rules for longs |
--long-preserving-rules | --no-long-preserving-rules
Make string literals const
|
--const-string-literals | --no-const-string-literals
Enable or disable support for exception handling |
--exceptions | --no-exceptions -x
Enable the diagnostics of noncompliance with the "Embedded C++" subset |
--embedded-c++ |
Enable or disable support for embedded C++ language extension keywords |
--embedded | --no-embedded
Enable or disable operator functions to overload builtin operators on enum-typed operands |
--enum-overloading | --no-enum-overloading
Enable or disable support for the explicit specifier on constructor declarations |
--explicit | --no-explicit
Enable or disable inline function with external C++ linkage |
--extern-inline | --no-extern-inline
Enable or disable implicit type conversion between external C and C++ function pointers |
--implicit-extern-c-type- | conversion --no-implicit-extern-c-type-conversion
Suppress type info variables in generated C |
--suppress-typeinfo-vars |
Suppress definition of virtual function tables |
--suppress-vtbl |
Force definition of virtual function tables |
--force-vtbl |
Enable or disable anachronisms |
--anachronisms | --no-anachronisms
Enable or disable the anachronism of accepting a copy assignment operator with a base class as a default for the derived class |
--base-assign-op-is-default | --no-base-assign-op-is-default
Enable or disable the anachronism of allowing a reference to nonconst to bind to a class rvalue of the right type |
--nonconst-ref-anachronism | --no-nonconst-ref-anachronism
Use (or do not use) a non-standard template argument deduction method |
--nonstd-qualifier-deduction | --no-nonstd-qualifier-deduction
Allow or disallow unqualified name in non-member using declaration |
--nonstd-using-decl | --no-nonstd-using-decl
Perform argument dependent lookup of unqualified function names |
--arg-dep-lookup | --no-arg-dep-lookup
Add class name to the scope of the class |
--class-name-injection | --no-class-name-injection
Control the visibility of friend declarations |
--friend-injection | --no-friend-injection
Early or late handling of tie-breakers in overload resolution |
--early-tiebreaker | --late-tiebreaker
Enable or disable support for array new and delete |
--array-new-and-delete | --no-array-new-and-delete
Enable or disable support for namespaces |
--namespaces | --no-namespaces
New-style for-scoping rules |
--new-for-init |
Old-style for-scoping rules |
--old-for-init |
Enable or disable implicit use of the std namespace when standard header files are included |
--using-std | --no-using-std
Enable or disable support for RTTI (run-time type information) |
--rtti | --no-rtti
Enable or disable recognition of bool |
--bool | --no-bool
Enable or disable recognition of typename |
--typename | --no-typename
Enable or disable implicit determination, from context, whether a template parameter dependent name is a type or nontype |
--implicit-typename | --no-implicit-typename
Enable or disable a special nonstandard weighting of the conversion to the integral operand of the [] operator in overload resolution. |
--special-subscript-cost | --no-special-subscript-cost
Enable or disable recognition of wchar_t as a keyword |
--wchar_t-keyword | --no-wchar_t-keyword
Select lifetime for temporaries |
--long-lifetime-temps | --short-lifetime-temps
Enable or disable recognition of alternative tokens |
--alternative-tokens | --no-alternative-tokens
Enable or disable minimal inlining of function calls |
--inlining | --no-inlining
Enable or disable the removal of unneeded entities from the generated intermediate C file |
--remove-unneeded-entities | --no-remove-unneeded-entities
Template instantiation options |
|
Control instantiation of external template entities |
--instantiate mode
| -t mode
Enable or disable automatic instantiation of templates |
--auto-instantiation | --no-auto-instantiation -T
Create separate instantiation files |
--one-instantiation-per-object |
Write instantiation files to dir |
--instantiation-dir dir |
Enable or disable implicit inclusion of source files as a method of finding definitions of template entities to be instantiated |
--implicit-include | --no-implicit-include -B
Maximum number of instantiations for a single template (default 64) |
--pending-instantiations n |
Dis-allow or allow normal functions as template instantiation |
--distinct-template-signatures | --no-distinct-template-signatures
Enable or disable recognition of "guiding declarations" of template functions |
--guiding-decls | --no-guiding-decls
Enable or disable old-style template specialization |
--old-specializations | --no-old-specializations
Precompiled header options |
|
Automatically use and/or create a precompiled header file |
--pch |
Create a precompiled header file with the specified name |
--create-pch file |
Use a precompiled header file of the specified name |
--use-pch file |
Specify directory dir in which to search for and/or create a precompiled header file |
--pch-dir dir |
Enable or disable the display of a message indicating that a precompiled header file was created or used in the current compilation |
--pch-messages | --no-pch-messages
Generate a message when a precompiled header file cannot be used |
--pch-verbose |
Output file options |
|
Specify name of preprocess or intermediate output file
|
--output file | -o file
Specify name of generated C output file
|
--gen-c-file-name file |
Diagnostic options |
|
Display invocation syntax |
-? |
Display version header only |
--version | -V -v
Generate compilation timing information |
--timing | -#
Send diagnostics to error list file |
--error-output efile |
Generate raw list file lfile |
--list-file lfile
| -L lfile
Generate cross-reference file xfile |
--xref xfile | -X xfile
Override normal error severity |
--diag-suppress tag[,tag]... | --diag-remark tag[,tag]... --diag-warning tag[,tag]... --diag-error tag[,tag]...
Treat warnings as errors |
--warnings-as-errors
|
Display error number in diagnostic messages |
--display-error-number |
Specify maximum number of errors |
--error-limit number
| -enumber
Issue remarks |
--remarks | -r
Suppress all warning messages |
--no-warnings | -w
Suppress warnings on local automatic variables that are used before their values are set |
--no-use-before-set-warnings | -j
Enable or disable a shorter form of diagnostic output |
--brief-diagnostics | --no-brief-diagnostics
Enable or disable TASKING style diagnostic messages |
--tsw-diagnostics | --no-tsw-diagnostics
Enable or disable wrapping of diagnostic messages |
--wrap-diagnostics | --no-wrap-diagnostics
Enable or disable warning when old-style for-scoping is used |
--for-init-diff-warning | --no-for-init-diff-warning |
Table 4-2: Compiler options (functional)
Option letters are listed below. If the same option is used more than once, the first (most left) occurrence is used. The placement of command line options is of no importance except for the -I option. Some options also have a "no-" form. These options are described together.
-?
Display an explanation of options at stdout.
cptc -?
--alternative-tokens
--no-alternative-tokens
--alternative-tokens
Enable or disable recognition of alternative tokens. This controls recognition of the digraph tokens in C++, and controls recognition of the operator keywords (e.g., not, and, bitand, etc.).
To disable operator keywords (e.g., "not", "and") and digraphs, enter:
cptc --no-alternative-tokens test.cc
--anachronisms
--no-anachronisms
--no-anachronisms
Enable or disable anachronisms.
cptc --anachronisms test.cc
--nonconst-ref-anachronisms,
--cfront-2.1 / -b / --cfront-3.0
Section Anachronisms Accepted in chapter Language Implementation.
--arg-dep-lookup
--no-arg-dep-lookup
--arg-dep-lookup
Controls whether argument dependent lookup of unqualified function names is performed.
cptc --no-arg-dep-lookup test.cc
--array-new-and-delete
--no-array-new-and-delete
--array-new-and-delete
Enable or disable support for array new and delete.
cptc --no-array-new-and-delete test.cc
-T / --auto-instantiation
--no-auto-instantiation
--auto-instantiation
-T is equivalent to --auto-instantiation. Enable or disable automatic instantiation of templates.
cptc --no-auto-instantiation test.cc
--instantiate / -t
Section Template Instantiation in chapter Language Implementation.
--base-assign-op-is-default
--no-base-assign-op-is-default
--base-assign-op-is-default (in cfront compatibility mode)
Enable or disable the anachronism of accepting a copy assignment operator that has an input parameter that is a reference to a base class as a default copy assignment operator for the derived class.
cptc --base-assign-op-is-default test.cc
--bool
--no-bool
--bool
Enable or disable recognition of the bool keyword.
cptc --no-bool test.cc
--brief-diagnostics
--no-brief-diagnostics
--brief-diagnostics
Enable or disable a mode in which a shorter form of the diagnostic output is used. When enabled, the original source line is not displayed and the error message text is not wrapped when too long to fit on a single line.
cptc --no-brief-diagnostics test.cc
--wrap-diagnostics
Chapter Compiler Diagnostics
and Appendix Error Messages.
-Ccpu
The CPU name which identifies your TriCore derivative.
Use special function register definitions for cpu. The filename looked for is "regcpu.sfr" in the same way include files whose names are enclosed in "" are searched. The file is included before compiling the source.
To specify to the C++ compiler to look for a file named regtc10gp.sfr, and to use this file as a special function register definition file, enter:
cptc -Ctc10gp test.cc
-b / --cfront-2.1
--cfront-3.0
Normal C++ mode.
-b is equivalent to --cfront-2.1. -- cfront-2.1 or --cfront-3.0 enable compilation of C++ with compatibility with cfront version 2.1 or 3.0 respectively. This causes the compiler to accept language constructs that, while not part of the C++ language definition, are accepted by the AT&T C++ Language System (cfront) release 2.1 or 3.0 respectively. These options also enable acceptance of anachronisms.
To compile C++ compatible with cfront version 3.0, enter:
cptc --cfront-3.0 test.cc
--anachronisms
Section
Extensions Accepted in Cfront 2.1 and 3.0 Compatibility Mode in chapter Language Implementation.
--class-name-injection
--no-class-name-injection
--class-name-injection
Controls whether the name of a class is injected into the scope of the class (as required by the standard) or is not injected (as was true in earlier versions of the C++ language).
cptc --no-class-name-injection test.cc
-C
--comments
Keep comments in the preprocessed output. This should be specified after either --preprocess or --no-line-commands; it does not of itself request preprocessing output.
To do preprocessing only, with comments and with line control information, enter:
cptc -E -C test.cc
--preprocess / -E, --no-line-commands / -P
--const-string-literals
--no-const-string-literals
--const-string-literals
Control whether C++ string literals and wide string literals are const (as required by the standard) or non-const (as was true in earlier versions of the C++ language).
cptc --no-const-string-literals test.cc
--create-pch filename
A filename specifying the precompiled header file to create.
If other conditions are satisfied (see the Precompiled Headers section), create a precompiled header file with the specified name. If --pch (automatic PCH mode) or --use-pch appears on the command line following this option, its effect is erased.
To create a precompiled header file with the name test.pch, enter:
cptc --create-pch test.pch test.cc
--pch, --use-pch
Section Precompiled Headers in chapter Language Implementation.
-Dmacro
[(parm-list)][=
def]
--define macro [(parm-list)][=def]
The macro you want to define and optionally its definition.
Define macro to the preprocessor, as in #define. If def is not given ('=' is absent), '1' is assumed. Function-style macros can be defined by appending a macro parameter list to name. Any number of symbols can be defined. The definition can be tested by the preprocessor with #if, #ifdef and #ifndef, for conditional compilations.
cptc -DNORAM -DPI=3.1416 test.cc
-M
--dependencies
Do preprocessing only. Instead of the normal preprocessing output, generate on the preprocessing output file a list of dependency lines suitable for input to a 'make' utility.
When implicit inclusion of templates is enabled, the
output may indicate false (but safe) dependencies unless --no-preproc-only is also used.
When you use the control program you have to use the -Em option instead, to obtain the same result.
cptc -M test.cc
test.ic: test.cc
--preprocess / -E, --no-line-commands / -P
--diag-suppress tag[,tag]...
--diag-remark tag[,tag]...
--diag-warning tag[,tag]...
--diag-error tag[,tag]...
A mnemonic error tag or an error number.
Override the normal error severity of the specified diagnostic messages. The message(s) may be specified using a mnemonic error tag or using an error number. The error tag names and error numbers are listed in the Error Messages appendix.
When you want diagnostic error 20 to be a warning, enter:
cptc --diag-warning 20 test.cc
Chapter Compiler Diagnostics
and Appendix Error Messages.
--display-error-number
Display the error message number in any diagnostic messages that are generated. The option may be used to determine the error number to be used when overriding the severity of a diagnostic message. The error numbers are listed in the Error Messages appendix.
Normally, diagnostics are written to stderr in the following form:
With --display-error-number this form will be:
or:
If the severity may be overridden, the error number will include the suffix -D (for discretionary); otherwise no suffix will be present.
cptc --display-error-number test.cc
"test.cc", line 7: error #64-D: declaration does not declare anything
struct ; ^
Chapter Compiler Diagnostics
and Appendix Error Messages.
--distinct-template-signatures
--no-distinct-template-signatures
--distinct-template-signatures
Control whether the signatures for template functions can match those for non-template functions when the functions appear in different compilation units. The default is --distinct-template-signatures, under which a normal function cannot be used to satisfy the need for a template instance; e.g., a function "void f(int)" could not be used to satisfy the need for an instantiation of a template "void f(T)" with T set to int. --no-distinct-template-signatures provides the older language behavior, under which a non-template function can match a template function. Also controls whether function templates may have template parameters that are not used in the function signature of the function template
cptc --no-distinct-template-signatures test.cc
-$
--dollar
No dollar signs are allowed in identifiers.
Accept dollar signs in identifiers. Names like A$VAR are allowed.
cptc -$ test.cc
--early-tiebreaker
--late-tiebreaker
--early-tiebreaker
Select the way that tie-breakers (e.g., cv-qualifier differences) apply in overload resolution. In "early" tie-breaker processing, the tie-breakers are considered at the same time as other measures of the goodness of the match of an argument value and the corresponding parameter type (this is the standard approach). In "late" tie-breaker processing, tie-breakers are ignored during the initial comparison, and considered only if two functions are otherwise equally good on all arguments; the tie-breakers can then be used to choose one function over another.
cptc --late-tiebreaker test.cc
--embedded
--no-embedded
--embedded
Enable or disable support for embedded C++ language extension keywords.
To disable embedded C++ language extension keywords, enter:
cptc --no-embedded test.cc
--embedded-c++
Enable the diagnostics of noncompliance with the "Embedded C++" subset (from which templates, exceptions, namespaces, new-style casts, RTTI, multiple inheritance, virtual base classes, and mutable are excluded.
To enable the diagnostics of noncompliance with the "Embedded C++" subset, enter:
cptc --embedded-c++ test.cc
--enum-overloading
--no-enum-overloading
--enum-overloading
Enable or disable support for using operator functions to overload builtin operations on enum-typed operands.
To disable overloading builtin operations on enum-typed operands, enter:
cptc --no-enum-overloading test.cc
-enumber
--error-limit number
An error limit number.
--error-limit 100
Set the error limit to number. The C++ compiler will abandon compilation after this number of errors (remarks and warnings are not counted toward the limit). By default, the limit is 100.
When you want compilation to stop when 10 errors occurred, enter:
cptc -e10 test.cc
--error-output efile
The name for an error output file.
Redirect the output that would normally go to stderr (that is, diagnostic messages) to the file efile. This option is useful on systems where output redirection of files is not well supported. If used, this option should probably be specified first in the command line, since otherwise any command-line errors for options preceding the --error-output would be written to stderr before redirection.
To write errors to the file test.err instead of stderr, enter:
cptc --error-output test.err test.cc
-x / --exceptions
--no-exceptions
--no-exceptions
Enable or disable support for exception handling. -x is equivalent to --exceptions.
cptc --exceptions test.cc
--explicit
--no-explicit
--explicit
Enable or disable support for the explicit specifier on constructor declarations.
To disable support for the explicit specifier on constructor declarations, enter:
cptc --no-explicit test.cc
--extended-variadic-macros
--no-extended-variadic-macros
--no-extended-variadic-macros
Allow or disallow macros with a variable number of arguments (implies --variadic-macros) and alow or disallow the naming of the variable argument list.
cptc --extended-variadic-macros test.cc
--extern-inline
--no-extern-inline
--extern-inline
Enable or disable support for inline functions with external linkage in C++. When inline functions are allowed to have external linkage (as required by the standard), then extern and inline are compatible specifiers on a non-member function declaration; the default linkage when inline appears alone is external (that is, inline means extern inline on non-member functions); and an inline member function takes on the linkage of its class (which is usually external). However, when inline functions have only internal linkage (as specified in the ARM), then extern and inline are incompatible; the default linkage when inline appears alone is internal (that is, inline means static inline on non-member functions); and inline member functions have internal linkage no matter what the linkage of their class.
cptc --no-extern-inline test.cc
-F
-F forces using single precision floating point only, even when double or long double is used. In fact double and long double are treated as float and default argument promotion from float to double is suppressed. Every expression is evaluated in single precision. This saves a lot of code and increases the execution speed.
To force double to be treated as float, enter:
cptc -F test.cc
--for-init-diff-warning
--no-for-init-diff-warning
--for-init-diff-warning
Enable or disable a warning that is issued when programs compiled under the new for-init scoping rules would have had different behavior under the old rules. The diagnostic is only put out when the new rules are used.
cptc --no-for-init-diff-warning test.cc
--new-for-init / --old-for-init
--force-vtbl
Force definition of virtual function tables in cases where the heuristic used by the C++ compiler to decide on definition of virtual function tables provides no guidance. See --suppress-vtbl.
cptc --force-vtbl test.cc
--friend-injection
--no-friend-injection
--no-friend-injection
Controls whether the name of a class or function that is declared only in friend declarations is visible when using the normal lookup mechanisms. When friend names are injected, they are visible to such lookups. When friend names are not injected (as required by the standard), function names are visible only when using argument-dependent lookup, and class names are never visible.
cptc --friend-injection test.cc
--gen-c-file-name file
An output filename.
Module name with .ic suffix.
This option specifies the file name to be used for the generated C output.
To specify the file out.ic as the output file instead of test.ic, enter:
cptc --gen-c-file-name out.ic test.cc
--guiding-decls
--no-guiding-decls
--guiding-decls
Enable or disable recognition of "guiding declarations" of template functions. A guiding declaration is a function declaration that matches an instance of a function template but has no explicit definition (since its definition derives from the function template). For example:
template <class T> void f(T) { ... } void f(int);
When regarded as a guiding declaration, f(int) is an instance of the template; otherwise, it is an independent function for which a definition must be supplied. If --no-guiding-decls is combined with --old-specializations, a specialization of a non-member template function is not recognized -- it is treated as a definition of an independent function.
cptc --no-guiding-decls test.cc
--implicit-extern-c-type-conversion
--no-implicit-extern-c-type-conversion
--implicit-extern-c-type-conversion
Enable or disable an extension to permit implicit type conversion in C++ between a pointer to an extern "C" function and a pointer to an extern "C++" function. This extension is allowed in environments where C and C++ functions share the same calling conventions.
cptc --no-implicit-extern-c-type-conversion test.cc
-B / --implicit-include
--no-implicit-include
--no-implicit-include
Enable or disable implicit inclusion of source files as a method of finding definitions of template entities to be instantiated. -B is equivalent to --implicit-include.
cptc --implicit-include test.cc
--instantiate / -t
Section Template Instantiation in chapter Language Implementation.
--implicit-typename
--no-implicit-typename
--implicit-typename
Enable or disable implicit determination, from context, whether a template parameter dependent name is a type or nontype.
cptc --no-implicit-typename test.cc
--include-suffixes suffixes
A colon-separated list of suffixes (e.g., "h:hpp::").
Specifies the list of suffixes to be used when searching for an include file whose name was specified without a suffix. If a null suffix is to be allowed, it must be included in the suffix list.
The default suffix list is no extension, .h and .hpp.
To allow only the suffixes .h and .hpp as include file extensions, enter:
cptc --incl-suffixes h:hpp test.cc
Section 4.2
, Include Files.
-Idirectory
--include-directory directory
The name of the directory to search for include file(s).
Change the algorithm for searching #include files whose names do not have an absolute pathname to look in directory.
cptc -I/proj/include test.cc
Section 4.2
, Include Files.
--sys-include
--include-file filename
The name of file to include at the beginning of the compilation.
Include the source code of the indicated file at the beginning of the compilation. This can be used to establish standard macro definitions, etc.
The filename is searched for in the directories on the include search list.
cptc --include-file extra.h test.cc
Section 4.2
, Include Files.
--inlining
--no-inlining
--inlining
Enable or disable minimal inlining of function calls.
To disable function call inlining, enter:
cptc --no-inlining test.cc
-tmode
--instantiate mode
instantiate mode
The instantiation mode, which can be one of:
-tnone
Control instantiation of external template entities. External template entities are external (that is, noninline and nonstatic) template functions and template static data members. The instantiation mode determines the template entities for which code should be generated based on the template definition:
none Instantiate no template entities. This is the default.
used Instantiate only the template entities that are used in this compilation.
all Instantiate all template entities whether or not they are used.
local Instantiate only the template entities that are used in this compilation, and force those entities to be local to this compilation.
To specify to instantiate only the template entities that are used in this compilation, enter:
cptc -tused test.cc
--auto-instantiation / -T
Section Template Instantiation in chapter Language Implementation.
--instantiation-dir directory
The name of the directory to write instantiation files to.
You can use this option in combination with option --one-instantiation-per-object to specify a directory into which the generated object files should be put.
To create separate instantiation files in directory /proj/template, enter:
cptc --one-instantiation-per-object \ --instantiation-dir /proj/template test.cc
Section Template Instantiation in chapter Language Implementation.
--one-instantiation-per-object
-Llfile
--list-file lfile
The name of the list file.
Generate raw listing information in the file lfile. This information is likely to be used to generate a formatted listing. The raw listing file contains raw source lines, information on transitions into and out of include files, and diagnostics generated by the C++ compiler. Each line of the listing file begins with a key character that identifies the type of line, as follows:
N: a normal line of source; the rest of the line is the text of the line.
X: the expanded form of a normal line of source; the rest of the line is the text of the line. This line appears following the N line, and only if the line contains non-trivial modifications (comments are considered trivial modifications; macro expansions, line splices, and trigraphs are considered non-trivial modifications).
S: a line of source skipped by an #if or the like; the rest of the line is text. Note that the #else, #elif, or #endif that ends a skip is marked with an N.
L: an indication of a change in source position. The line has a format similar to the # line-identifying directive output by cpp, that is to say
R, W, E, or C: an indication of a diagnostic (R for remark, W for warning, E for error, and C for catastrophic error). The line has the form
To write raw listing information to the file test.lst, enter:
cptc -L test.lst test.cc
--long-lifetime-temps
--short-lifetime-temps
--long-lifetime-temps (cfront)
--short-lifetime-temps (standard
C++)
Select the lifetime for temporaries: short means to end of full expression; long means to the earliest of end of scope, end of switch clause, or the next label. Short is standard C++, and long is what cfront uses (the cfront compatibility modes select long by default).
cptc --long-lifetime-temps test.cc
--long-preserving-rules
--no-long-preserving-rules
--no-long-preserving-rules
Enable or disable the K&R usual arithmetic conversion rules with respect to long. This means the rules of K&R I, Appendix A, 6.6. The significant difference is in the handling of "long op unsigned int" when int and long are the same size. The ANSI/ISO rules say the result is unsigned long, but K&R I says the result is long (unsigned long did not exist in K&R I).
The default is the ANSI/ISO rule.
cptc --long-preserving-rules test.cc
--namespaces
--no-namespaces
--namespaces
Enable or disable support for namespaces.
cptc --no-namespaces test.cc
--using-std
Section Namespace Support
in chapter Language Implementation.
--new-for-init
--old-for-init
--new-for-init
Control the scope of a declaration in a for-init-statement. The old (cfront-compatible) scoping rules mean the declaration is in the scope to which the for statement itself belongs; the new (standard-conforming) rules in effect wrap the entire for statement in its own implicitly generated scope.
cptc --old-for-init test.cc
-n
--no-code-gen
Do syntax-checking only. Do not generate a C file.
cptc --no-code-gen test.cc
-P
--no-line-commands
Do preprocessing only. Write preprocessed text to the preprocessing output file, with comments removed and without line control information. When you use the -P option, use the -o option to separate the output from the header produced by the compiler.
cptc -P -o preout test.cc
--comments / -C, --preprocess / -E, --dependencies / -M
--nonconst-ref-anachronism
--no-nonconst-ref-anachronism
--nonconst-ref-anachronism
Enable or disable the anachronism of allowing a reference to nonconst to bind to a class rvalue of the right type. This anachronism is also enabled by the --anachronisms option and the cfront-compatibility options.
cptc --no-nonconst-ref-anachronism test.cc
--anachronisms, --cfront-2.1 / -b / --cfront-3.0
Section Anachronisms Accepted in chapter Language Implementation.
--nonstd-qualifier-deduction
--no-nonstd-qualifier-deduction
--no-nonstd-qualifier-deduction
Controls whether nonstandard template argument deduction should be performed in the qualifier portion of a qualified name. With this feature enabled, a template argument for the template parameter T can be deduced in contexts like A<T>::B or T::B. The standard deduction mechanism treats these as nondeduced contexts that use the values of template parameters that were either explicitly specified or deduced elsewhere.
cptc --nonstd-qualifier-deduction test.cc
--nonstd-using-decl
--no-nonstd-using-decl
--no-nonstd-using-decl
Controls whether a non-member using declaration that specifies an unqualified name is allowed.
cptc --nonstd-using-decl test.cc
--no-preproc-only
May be used in conjunction with the options that normally cause the C++ compiler to do preprocessing only (e.g., --preprocess, etc.) to specify that a full compilation should be done (not just preprocessing). When used with the implicit inclusion option, this makes it possible to generate a preprocessed output file that includes any implicitly included files.
cptc -E -B --no-preproc-only test.cc
--preprocess / -E,
--implicit-include / -B, --no-line-commands / -P
-j
--no-use-before-set-warnings
Suppress warnings on local automatic variables that are used before their values are set.
cptc -j test.cc
-w
--no-warnings
Suppress all warning messages. Error messages are still issued.
To suppress all warnings, enter:
cptc -w test.cc
--old-line-commands
When generating source output, put out #line directives in the form used by the Reiser cpp, that is, # nnn instead of #line nnn.
To do preprocessing only, without comments and with old style line control information, enter:
cptc -E --old-line-commands test.cc
--preprocess / -E, --no-line-commands / -P
--old-specializations
--no-old-specializations
--old-specializations
Enable or disable acceptance of old-style template specializations (that is, specializations that do not use the template<> syntax).
cptc --no-old-specializations test.cc
--old-style-preprocessing
Forces pcc style preprocessing when compiling. This may be used when compiling an ANSI C++ program on a system in which the system header files require pcc style preprocessing.
To force pcc style preprocessing, enter:
cptc -E --old-style-preprocessing test.cc
--preprocess / -E, --no-line-commands / -P
--one-instantiation-per-object
Put out each template instantiation in this compilation (function or static data member) in a separate object file. The primary object file contains everything else in the compilation, that is, everything that is not an instantiation. Having each instantiation in a separate object file is very useful when creating libraries, because it allows the user of the library to pull in only the instantiations that are needed. That can be essential if two different libraries include some of the same instantiations.
To create separate instantiation files, enter:
cptc --one-instantiation-per-object test.cc
Section Template Instantiation in chapter Language Implementation.
-o file
--output file
An output filename specifying the preprocessing or intermediate language output file.
No intermediate output file is generated.
Use file as output filename for the preprocessing or intermediate language output file.
To use the file my.pre as the preprocessing output file, enter:
cptc -E -o my.pre test.cc
--preprocess / -E, --no-line-commands / -P
--pch
Automatically use and/or create a precompiled header file. For details, see the Precompiled Headers section in chapter Language Implementation. If --use-pch or --create-pch (manual PCH mode) appears on the command line following this option, its effect is erased.
cptc --pch test.cc
--use-pch, --create-pch
Section Precompiled Headers in chapter Language Implementation.
--pch-dir dir_name
The name of the directory to search for and/or create a precompiled header file.
Specify the directory in which to search for and/or create a precompiled header file. This option may be used with automatic PCH mode (--pch) or manual PCH mode (--create-pch or --use-pch).
To use the directory /usr/include/pch to automatically create precompiled header files, enter:
cptc --pch-dir /usr/include/pch --pch test.cc
--pch, --use-pch, --create-pch
Section Precompiled Headers in chapter Language Implementation.
--pch-messages
--no-pch-messages
--pch-messages
Enable or disable the display of a message indicating that a precompiled header file was created or used in the current compilation.
cptc --create-pch test.pch --pch-messages test.cc
"test.cc": creating precompiled header file "test.pch"
--pch, --use-pch, --create-pch
Section Precompiled Headers in chapter Language Implementation.
--pch-verbose
In automatic PCH mode, for each precompiled header file that cannot be used for the current compilation, a message is displayed giving the reason that the file cannot be used.
cptc --pch --pch-verbose test.cc
--pch
Section Precompiled Headers in chapter Language Implementation.
--pending-instantiations n
The maximum number of instantiation for a single template.
64
Specifies the maximum number of instantiations of a given template that may be in process of being instantiated at a given time. This is used to detect runaway recursive instantiations. If n is zero, there is no limit.
To specify a maximum of 32 pending instantiations, enter:
cptc --pending-instantiations 32 test.cc
Section Template Instantiation in chapter Language Implementation.
-E
--preprocess
Do preprocessing only. Write preprocessed text to the preprocessing output file, with comments removed and with line control information. When you use the -E option, use the -o option to separate the output from the header produced by the compiler.
cptc -E -o preout test.cc
--comments / -C,
--dependencies / -M,
--no-line-commands / -P
-r
--remarks
Issue remarks, which are diagnostic messages even milder than warnings.
To enable the display of remarks, enter:
cptc -r test.cc
--remove-unneeded-entities
--no-remove-unneeded-entities
--remove-unneeded-entities
Enable or disable an optimization to remove unneeded entities from the generated intermediate C file. Something may be referenced but unneeded if it is referenced only by something that is itself unneeded; certain entities, such as global variables and routines defined in the translation unit, are always considered to be needed.
cptc --no-remove-unneeded-entities test.cc
--rtti
--no-rtti
--no-rtti
Enable or disable support for RTTI (run-time type information) features: dynamic_cast, typeid.
cptc --rtti test.cc
-s
--signed-chars
Treat 'character' type variables as 'signed character' variables. When plain char is signed, the macro __SIGNED_CHARS__ is defined.
cptc -s test.cc
--special-subscript-cost
--no-special-subscript-cost
--no-special-subscript-cost
Enable or disable a special nonstandard weighting of the conversion to the integral operand of the [] operator in overload resolution.
This is a compatibility feature that may be useful with some existing code. The special cost is enabled by default in cfront 3.0 mode. With this feature enabled, the following code compiles without error:
struct A { A(); operator int *(); int operator[](unsigned); }; void main() { A a; a[0]; // Ambiguous, but allowed with this option // operator[] is chosen }
cptc --special-subscript-cost test.cc
-A / --strict
-a / --strict-warnings
Enable strict ANSI mode, which provides diagnostic messages when non-ANSI features are used, and disables features that conflict with ANSI C or C++. ANSI violations can be issued as either warnings or errors depending on which command line option is used. The --strict options issue errors and the --strict-warnings options issue warnings. The error threshold is set so that the requested diagnostics will be listed.
To enable strict ANSI mode, with error diagnostic messages, enter:
cptc -A test.cc
--suppress-typeinfo-vars
Suppress the generation of type info variables when run-time type info (RTTI) is disabled. By default only type info variables are generated, no other run-time type info. With this option you can also suppress type info varables.
cptc --suppress-typeinfo-vars test.cc
--suppress-vtbl
Suppress definition of virtual function tables in cases where the heuristic used by the C++ compiler to decide on definition of virtual function tables provides no guidance. The virtual function table for a class is defined in a compilation if the compilation contains a definition of the first non-inline non-pure virtual function of the class. For classes that contain no such function, the default behavior is to define the virtual function table (but to define it as a local static entity). The --suppress-vtbl option suppresses the definition of the virtual function tables for such classes, and the --force-vtbl option forces the definition of the virtual function table for such classes. --force-vtbl differs from the default behavior in that it does not force the definition to be local.
cptc --suppress-vtbl test.cc
--sys-include directory
The name of the system include directory to search for include file(s).
Change the algorithm for searching system include files whose names do not have an absolute pathname to look in directory.
cptc --sys-include /proj/include test.cc
Section 4.2
, Include Files.
--include-directory
-#
--timing
No timing information is generated.
Generate compilation timing information. This option causes the compiler to display the amount of CPU time and elapsed time used by each phase of the compilation and a total for the entire compilation.
cptc -# test.cc
processed 180 lines at 8102 lines/min
-H
--trace-includes
Do preprocessing only. Instead of the normal preprocessing output, generate on the preprocessing output file a list of the names of files #included.
cptc -H test.cc
iostream.h string.h
--preprocess / -E, --no-line-commands / -P
--tsw-diagnostics
--no-tsw-diagnostics
--tsw-diagnostics
Enable or disable a mode in which the error message is given in the TASKING style. So, in the same format as the TASKING C compiler messages.
cptc --no-tsw-diagnostics test.cc
--brief-diagnostics
Chapter Compiler Diagnostics
and Appendix Error Messages.
--typename
--no-typename
--typename
Enable or disable recognition of the typename keyword.
cptc --no-typename test.cc
-Uname
--undefine name
The name macro you want to undefine.
Remove any initial definition of identifier name as in #undef, unless it is a predefined ANSI standard macro. ANSI specifies the following predefined symbols to exist, which cannot be removed:
__FILE__ "current source filename"
__LINE__ current source line number (int type)
__TIME__ "hh:mm:ss"
__DATE__ "Mmm dd yyyy"
__STDC__ level of ANSI standard. This macro is set to 1 when the option to disable language extensions (-A) is effective. Whenever language extensions are excepted, __STDC__ is set to 0 (zero).
__cplusplus is defined when compiling a C++ program
When cptc is invoked, also the following predefined symbols exist:
c_plusplus is defined in addition to the standard __cplusplus
__SIGNED_CHARS__
is defined when plain char is signed.
_WCHAR_T is defined when wchar_t is a keyword.
_BOOL is defined when bool is a keyword.
__ARRAY_OPERATORS
is defined when array new and delete are enabled.
These symbols can be turned off with the -U option.
cptc -Uc_plusplus test.cc
-u
--unsigned-chars
Treat 'character' type variables as 'unsigned character' variables.
cptc -u test.cc
--use-pch filename
The filename to use as a precompiled header file.
Use a precompiled header file of the specified name as part of the current compilation. If --pch (automatic PCH mode) or --create-pch appears on the command line following this option, its effect is erased.
To use the precompiled header file with the name test.pch, enter:
cptc --use-pch test.pch test.cc
--pch, --create-pch
Section Precompiled Headers in chapter Language Implementation.
--using-std
--no-using-std
--using-std
Enable or disable implicit use of the std namespace when standard header files are included.
cptc --using-std test.cc
--namespaces
Section Namespace Support
in chapter Language Implementation.
--variadic-macros
--no-variadic-macros
--no-variadic-macros
Allow or disallow macros with a variable number of arguments.
cptc --variadic-macros test.cc
-V
-v
--version
Display version information.
cptc -V
TASKING TriCore VX-toolset C++ compiler vx.yrz Build nnn Copyright years Altium BV Serial# 00000000
--warnings-as-errors
Treat warning messages as errors. This also affects the return value of the application when only warnings occur. A build process will now stop when warnings occur.
The error messages are listed in Appendix B , Error Messages.
cptc --warnings-as-errors test.cc
--wchar_t-keyword
--no-wchar_t-keyword
--wchar_t-keyword
Enable or disable recognition of wchar_t as a keyword.
cptc --no-wchar_t-keyword test.cc
--wrap-diagnostics
--no-wrap-diagnostics
--wrap-diagnostics
Enable or disable a mode in which the error message text is not wrapped when too long to fit on a single line.
cptc --no-wrap-diagnostics test.cc
--brief-diagnostics
Chapter Compiler Diagnostics
and Appendix Error Messages.
-Xxfile
--xref xfile
The name of the cross-reference file.
Generate cross-reference information in the file xfile. For each reference to an identifier in the source program, a line of the form
is written, where X is
D for definition;
d for declaration (that is, a declaration that is not a definition);
M for modification;
A for address taken;
U for used;
C for changed (but actually meaning used and modified in a single operation, such as an increment);
R for any other kind of reference, or
E for an error in which the kind of reference is indeterminate.
symbol-id is a unique decimal number for the symbol. The fields of the above line are separated by tab characters.
You may specify include files in two ways: enclosed in <...> or enclosed in "...". When an #include directive is seen, the following algorithm is used to try to open the include file:
1. If the filename is enclosed in "...", and it is not an absolute pathname (does not begin with a '\' for PC, or a '/' for UNIX), the include file is searched for in the directory of the file containing the #include line. For example, in:
PC:
cptc ..\..\source\test.cc
UNIX:
cptc ../../source/test.cc
cptc first searches in the directory ..\..\source (../../source for UNIX) for include files.
If you compile a source file in the directory where the file is located (cptc test.cc), the compiler searches for include files in the current directory.
This first step is not done for include files enclosed
in <...>.
2. Use the directories specified with the -I or --include-directory option, in a left-to-right order. For example:
PC:
cptc -I..\..\include demo.cc
UNIX:
cptc -I../../include demo.cc
3. Check if the environment variable CPTCINC exists. If it does exist, use the contents as a directory specifier for include files. You can specify more than one directory in the environment variable CPTCINC by using a separator character. Instead of using -I as in the example above, you can specify the same directory using CPTCINC :
PC:
set CPTCINC=..\..\include cptc demo.cc
UNIX:
CPTCINC=../../include export CPTCINC cptc demo.cc
setenv CPTCINC ../../include cptc demo.cc
4. When an include file is not found with the rules mentioned above, the compiler tries the subdirectories include.cpp and include, one directory higher than the directory containing the cptc binary. For example:
PC:
UNIX:
The compiler determines run-time which directory the binary is executed from to find this include directory.
5. If the include file is still not found, the directories specified in the --sys-include option are searched.
A directory name specified with the -I option or in CPTCINC may or may not be terminated with a directory separator, because cptc inserts this separator, if omitted.
When you specify more than one directory to the environment variable CPTCINC , you have to use one of the following separator characters:
PC:
e.g. set CPTCINC=..\..\include;\proj\include
UNIX:
e.g. setenv CPTCINC ../../include:/proj/include
If the include directory is specified as -, e.g., -I-, the option indicates the point in the list of -I or --include-directory options at which the search for file names enclosed in <...> should begin. That is, the search for <...> names should only consider directories named in -I or --include-directory options following the -I-, and the directories of items 3 and 4 above. -I- also removes the directory containing the current input file (item 1 above) from the search path for file names enclosed in "...".
An include directory specified with the --sys-include option is considered a "system" include directory. Warnings are suppressed when processing files found in system include directories.
If the filename has no suffix it will be searched for by appending each of a set of include file suffixes. When searching in a given directory all of the suffixes are tried in that directory before moving on to the next search directory. The default set of suffixes is, no extension, .h and .hpp. The default can be overridden using the --incl-suffixes command line option. A null file suffix cannot be used unless it is present in the suffix list (that is, the C++ compiler will always attempt to add a suffix from the suffix list when the filename has no suffix).
According to ANSI (3.8.6) a preprocessing directive of the form:
#pragma pragma-token-list new-line
causes the compiler to behave in an implementation-defined manner. The compiler ignores pragmas which are not mentioned in the list below. Pragmas give directions to the code generator of the compiler. Besides the pragmas there are two other possibilities to steer the code generator: command line options and keywords. The compiler acknowledges these three groups using the following rule:
Command line options can be overruled by keywords and pragmas. Keywords can be overruled by pragmas. So the pragma has the highest priority.
This approach makes it possible to set a default optimization level for a source module, which can be overridden temporarily within the source by a pragma.
cptc supports the following pragmas and all pragmas that are described in the C Compiler, Assembler, Linker User's Guide::
instantiate
do_not_instantiate
can_instantiate
These are template instantiation pragmas. They are described in detail in the section Template Instantiation in chapter Language Implementation.
hdrstop
no_pch These are precompiled header pragmas. They are described in detail in the section Precompiled Headers in chapter Language Implementation.
once When placed at the beginning of a header file, indicates that the file is written in such a way that including it several times has the same effect as including it once. Thus, if the C++ compiler sees #pragma once at the start of a header file, it will skip over it if the file is #included again.
#pragma once // optional #ifndef FILE_H #define FILE_H ... body of the header file ... #endif
ident This pragma is given in the form:
The ANSI C standard [1-2.2.4] defines a number of translation limits, which a C compiler must support to conform to the standard. The standard states that a compiler implementation should be able to translate and execute a program that contains at least one instance of every one of the limits listed below. The C compiler's actual limits are given within parentheses.
Most of the actual compiler limits are determined by the amount of free memory in the host system. In this case a 'D' (Dynamic) is given between parentheses. Some limits are determined by the size of the internal compiler parser stack. These limits are marked with a 'P'. Although the size of this stack is 200, the actual limit can be lower and depends on the structure of the translated program.