GCC Command-Line Options

This part of the documentation is a modified version of the Command-Line Options section of the GCC Manual. Therefore it is licensed under the GNU Free Documentation License.

This section describes the options supported by gcc, the driver program of the GNU Compiler Collection, whose C compiler and assembler are used here. This program is called either by tigcc or by the IDE. tigcc simulates some of these options itself, namely '-E', '-S', and '-c', and it also has some additional ones. In the IDE, there is an item in the project settings where you can set the options described here, with some exceptions, including the switches mentioned above.

TIGCC normally does preprocessing, compilation, assembly and linking all in one step, and finally produces a file which is executable on the calculator. The "overall options" allow you to stop this process at an intermediate stage. For example, the '-c' option says not to run the linker. Then the output consists of object files output by the assembler.

Other options are passed on to one stage of processing. Some options control the preprocessor and others the compiler itself. Yet other options control the assembler and linker; most of these are not documented here, since you rarely need to use any of them. In fact, only those options which may be more or less useful with TIGCC are mentioned here (although we didn't check whether all of them are really usable in TIGCC). For more info about standard options that are recognized by the compiler, read the official manual.

We suggest that you use the '-O2' switch in all of your compilations; it increases speed and decreases the program size at the cost of compilation time.

tigcc accepts options and file names as operands. Many options have multi-letter names; therefore multiple single-letter options may not be grouped: '-dr' is very different from '-d -r'.

You can mix options and other arguments. For the most part, the order you use doesn't matter. Order does matter when you use several options of the same kind; for example, if you specify '-L' more than once, the directories are searched in the order specified.

Many options have long names starting with '-f' or with '-W' - for example, '-fforce-mem', '-fstrength-reduce', '-Wformat' and so on. Most of these have both positive and negative forms; the negative form of '-ffoo' would be '-fno-foo'. This manual documents only one of these two forms, whichever one is not the default.

Original author: Free Software Foundation, Inc.
Authors of the modifications: Zeljko Juric, Sebastian Reichelt, and Kevin Kofler
Published by the TIGCC Team.
See the History section for details and copyright information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the Invariant Sections being "GNU General Public License" and "Funding Free Software", the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled "GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.