2.3.1. Invoking the compiler

The command for invoking the ARM compilers is:

compiler [PCS-options] [source-language] [search-paths] [preprocessor-options] [output-format] [target-options] [debug-options] [code-generation-options] [warning-options] [additional-checks] [error-options] [source]

The command-line options can appear in any order. The options are:


This is one of armcc, tcc, armcpp, or tcpp.


This specifies the procedure call standard to use. See Procedure Call Standard options for details.


This specifies the variant of source language that is accepted by the compiler. The default is ANSI C for the C compilers and ISO Standard C++ for the C++ compilers. See Setting the source language for details.


This specifies the directories that are searched for included files. See Specifying search paths for details.


This specifies preprocessor behavior, including preprocessor output and macro definitions. See Setting preprocessor options for details.


This specifies the format for the compiler output. You can use these options to generate assembly language output listing files and object files. See Specifying output format for details.


This specifies the target processor or architecture. See Specifying the target processor or architecture for details.


This specifies whether or not debug tables are generated, and their format. See Generating debug information for details.


This specifies options such as optimization, byte order, and alignment of data produced by the compiler. See Controlling code generation for details.


This specifies whether specific warning messages are generated. See Controlling warning messages details.


This specifies several additional checks that can be applied to your code, such as checks for data flow anomalies and unused declarations. See Specifying additional checks for details.


This enables you to turn off specific recoverable errors or downgrade specific errors to warnings. See Controlling error messages for details.


This provides the filenames of one or more text files containing C or C++ source code. By default, the compiler looks for source files, and creates output files, in the current directory.

If a source file is an assembly file (that is, one with an .s extension) the assembler activates to process the source file.

Reading compiler options from a file

When the operating system restricts the command line length, use the following option to read additional command-line options from a file:

-via filename

This opens a file and reads additional command-line options from it. You can nest -via calls within via files by including -via filename2 in the file.

In the following example, the options specified in input.txt are read as the command-line is parsed:

armcpp -via input.txt source.c

See Appendix A Via File Syntax for more information on writing via files.

Specifying keyboard input

Use minus – as the source filename to instruct the compiler to take input from the keyboard. Input is terminated by entering Ctrl-D on UNIX environments or Ctrl-Z on MS Windows environments.

An assembly listing for the keyboard input is sent to the output stream after input has been terminated if both of the following are true:

  • no output file is specified

  • no preprocessor-only option is specified, for example -E.

If you specify an output file with the -o option, an object file is written. If you specify the -E option, the preprocessor output is sent to the output stream.

Getting help and version information

Use the -help option to view a summary of the main compiler command-line options.

Use the -vsn option to display the version string for the compiler.

Redirecting errors

Use the -errors filename option to redirect compiler error output to a file. Errors on the command line are not redirected.

Copyright © 1999-2001 ARM Limited. All rights reserved.ARM DUI 0067D