Keil Logo Arm Logo

Compiler User Guide

Default compiler behavior

Default compiler behavior

The default compiler configuration is determined by the filename extension, for example, filename.c, filename.cpp, but the command-line options can override this.

The compiler startup language can be C or C++ and the instruction set can be ARM or Thumb®.

When you compile multiple files with a single command, all files must be of the same type, either C or C++. The compiler cannot switch the language based on the file extension. The following example produces an error because the specified source files have different languages:

armcc -c test1.c test2.cpp

If you specify files with conflicting file extensions you can force the compiler to compile both files for C or for C++, regardless of file extension. For example:

armcc -c --cpp test1.c test2.cpp

Where an unrecognized extension begins with .c, for example, filename.cmd, an error message is generated.

Support for processing PreCompiled Header (PCH) files is not available when you specify multiple source files in a single compilation. If you request PCH processing and specify more than one primary source file, the compiler issues an error message, and aborts the compilation.

armcc can in turn invoke armasm and armlink. For example, if your source code contains embedded assembler, armasm is called. With regard to where armcc looks for the armasm and armlink binaries, it first checks the same location as armcc. If not found, it then checks the PATH locations for these binaries.

Copyright © 2007-2008, 2011-2012 ARM. All rights reserved.ARM DUI 0375D
Non-ConfidentialID062912

Keil logo

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.