Keil™, An ARM® Company

CARM User's Guide

Discontinued

Directives

The CARM Compiler provides a number of directives you may use to control source file compilation. Directives are composed of one or more letters or digits and, unless otherwise specified, may be specified after the filename on the command line or within the source file using #pragma. For example:

CA testfile.c SYMBOLS CODE DEBUG

or

#pragma SYMBOLS CODE DEBUG

The source file to compile is testfile.c and SYMBOLS, CODE, and DEBUG are the directives.

Control directives may be divided into three groups:

  • Source controls define macros on the command line and determine the name of the file to be compiled.
  • Object controls affect the form and content of the generated object module (*.OBJ). These directives allow you to specify the optimizing level or include debugging information in the object file.
  • Listing controls govern various aspects of the listing file (*.LST), in particular its format and specific content.

Note

  • The syntax is the same for the command line and #pragma. Multiple options, however, may be specified on the #pragma line.
  • Some directives may be specified only once at the beginning of a source file. If one of these directives is specified more than once, the compiler generates a fatal error and aborts compilation.

The following table is an alphabetical list of the control directives available in the CARM Compiler.

DirectiveGroupDescription
ARMObjectGenerates code for native ARM CPU mode.
BIGENDIAN1ObjectGenerates code for big endian configuration.
BROWSE1ObjectEnables source browser information.
CODE1ListingIncludes generated assembly in the listing file.
CONDListingIncludes (in the listing file) conditional source lines skipped by the preprocessor.
DEBUG1ObjectIncludes debugging information in the object file.
DEFINE3SourceDefines preprocessor names on the command line.
EJECT2ListingInserts a form feed character into the listing file.
FLOAT64ObjectEnables 64-bit floating-point math support.
INCDIR1SourceSets additional include file paths.
INIT2ObjectSignals variables that should be initialized at startup.
INTERWORKObjectGenerates veneers to allow code to be used from ARM and THUMB CPU mode.
LISTINCLUDEListingAdds contents of include files into the listing file.
NOALIAS1ObjectIgnores write operations through pointers when optimizing.
NOCONDListingExcludes (from the listing file) conditional source lines skipped by the preprocessor.
NOEXTEND1SourceDisables extensions to ANSI C.
NOINIT2ObjectSignals variables that should not be initialized at startup.
NOINTERWORKObjectGenerates code that can only be used from the current CPU mode.
NOOBJECT1ObjectDisables object file generation.
NOPRINT1ListingDisables listing file generation.
OBJECT1ObjectSpecifies the name for the object file.
OPTIMIZEObjectSpecifies the level of optimization performed by the compiler.
PACKObjectSpecifies the boundary for structure packing.
PAGELENGTH1ListingSpecifies the number of lines on a page in the listing file.
PAGEWIDTH1ListingSpecifies the number of characters on a line in the listing file.
PREPRINT1ListingProduces a preprocessor listing file with expanded macros.
PREPRINTONLY1ListingProduces a preprocessor listing file with expanded macros and halts.
PRINT1ListingSpecifies the name for the listing file.
RENAMECLASSObjectChanges the name of a pre-defined memory class.
RESTORE2ObjectRestores settings for the OPTIMIZE directive.
SAVE2ObjectSaves settings for the OPTIMIZE directive.
SIGNED_CHAR1ObjectDefaults all char types to signed.
SRC1ObjectCreates an assembler source file instead of an object file.
SYMBOLS1ListingIncludes a symbol list in the listing file.
TABS1ListingSpecifies the tab character expansion width for the listing file.
THUMB1ObjectGenerate code for native ARM CPU mode.
WARNING2ListingChanges the level of a warning.
WARNINGLEVEL1ListingSelects the level of warning detection.

Note

  1. These directives apply to the entire source file and may be specified only once on the command line or at the beginning of the source file using the #pragma statement. They may not be used more than once in a source file.
  2. These directives may not be specified on the command line. They may only be specified in the source file.
  3. Directives and arguments, with the exception of arguments specified with the DEFINE directive, are not case sensitive.