Keil Logo

Technical Support

On-Line Manuals

Compiler User Guide

Preface Overview of the Compiler Getting Started with the Compiler Compiler command-line syntax Compiler command-line options listed by group Default compiler behavior Order of compiler command-line options Using stdin to input source code to the compiler Directing output to stdout Filename suffixes recognized by the compiler Compiler output files Factors influencing how the compiler searches for Compiler command-line options and search paths Compiler search rules and the current place The ARMCC5INC environment variable Code compatibility between separately compiled and Linker feedback during compilation Unused function code Minimizing code size by eliminating unused functio Compilation build time Compilation build time Minimizing compilation build time Minimizing compilation build time with a single ar Effect of --multifile on compilation build time Minimizing compilation build time with parallel ma Compilation build time on Windows Compiler Features Compiler Coding Practices Compiler Diagnostic Messages Using the Inline and Embedded Assemblers of the AR Compiler Command-line Options Language Extensions Compiler-specific Features C and C++ Implementation Details What is Semihosting? Via File Syntax Summary Table of GNU Language Extensions Standard C Implementation Definition Standard C++ Implementation Definition C and C++ Compiler Implementation Limits

Order of compiler command-line options

2.4 Order of compiler command-line options

In general, compiler command-line options can appear in any order in a single compiler invocation. However, the effects of some options depend on the order they appear in the command line and how they are combined with other related options.

The compiler enables you to use multiple options even where these might conflict. This means that you can append new options to an existing command line, for example, in a makefile or a via file.
Where options override previous options on the same command line, the last option specified always takes precedence. For example:
armcc -O1 -O2 -Ospace -Otime ...
is executed by the compiler as:
armcc -O2 -Otime
You can use the environment variable ARMCC5_CCOPT to specify compiler command-line options. Options specified on the command line take precedence over options specified in the environment variable.
To see how the compiler has processed the command line, use the --show_cmdline option. This shows nondefault options that the compiler used. The contents of any via files are expanded. In the example used here, although the compiler executes armcc -O2 -Otime, the output from --show_cmdline does not include -O2. This is because -O2 is the default optimization level, and --show_cmdline does not show options that apply by default.
Non-ConfidentialPDF file icon PDF versionARM DUI0375H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.