SLAU132V October   2004  – February 2020

 

  1.   1
    1.     2
    2.     3
    3.     4
    4.     5
    5.     6
  2.   7
    1.     8
    2.     9
    3.     10
    4.     11
    5.     12
  3.   13
    1.     14
    2.     15
    3.     16
      1.      17
      2.      18
      3.      19
      4.      20
      5.      21
      6.      22
      7.      23
      8.      24
      9.      25
      10.      26
      11.      27
      12.      28
    4.     29
      1.      30
      2.      31
    5.     32
      1.      33
      2.      34
        1.       35
      3.      36
      4.      37
      5.      38
      6.      39
      7.      40
      8.      41
      9.      42
      10.      43
    6.     44
    7.     45
      1.      46
      2.      47
    8.     48
    9.     49
    10.     50
    11.     51
      1.      52
      2.      53
    12.     54
      1.      55
    13.     56
    14.     57
  4.   58
    1.     59
    2.     60
    3.     61
      1.      62
    4.     63
      1.      64
      2.      65
    5.     66
    6.     67
      1.      68
      2.      69
    7.     70
      1.      71
        1.       72
        2.       73
        3.       74
        4.       75
        5.       76
        6.       77
        7.       78
        8.       79
      2.      80
      3.      81
      4.      82
    8.     83
      1.      84
        1.       85
        2.       86
      2.      87
        1.       88
        2.       89
        3.       90
    9.     91
    10.     92
    11.     93
      1.      94
      2.      95
    12.     96
    13.     97
      1.      98
      2.      99
      3.      100
      4.      101
      5.      102
      6.      103
      7.      104
      8.      105
      9.      106
      10.      107
      11.      108
      12.      109
      13.      110
  5.   111
    1.     112
      1.      113
      2.      114
      3.      115
    2.     116
      1.      117
      2.      118
    3.     119
      1.      120
        1.       121
          1.        122
        2.       123
        3.       124
      2.      125
      3.      126
      4.      127
      5.      128
      6.      129
      7.      130
      8.      131
      9.      132
        1.       133
  6.   134
    1.     135
      1.      136
    2.     137
    3.     138
    4.     139
    5.     140
    6.     141
      1.      142
    7.     143
    8.     144
      1.      145
      2.      146
      3.      147
        1.       148
        2.       149
      4.      150
        1.       151
    9.     152
    10.     153
    11.     154
    12.     155
      1.      156
      2.      157
      3.      158
      4.      159
      5.      160
      6.      161
        1.       162
        2.       163
        3.       164
        4.       165
      7.      166
      8.      167
        1.       168
        2.       169
        3.       170
      9.      171
      10.      172
      11.      173
      12.      174
      13.      175
      14.      176
      15.      177
      16.      178
      17.      179
      18.      180
      19.      181
      20.      182
      21.      183
      22.      184
      23.      185
      24.      186
      25.      187
      26.      188
      27.      189
      28.      190
      29.      191
      30.      192
        1.       193
        2.       194
        3.       195
      31.      196
      32.      197
    13.     198
    14.     199
    15.     200
    16.     201
      1.      202
      2.      203
      3.      204
    17.     205
      1.      206
      2.      207
      3.      208
      4.      209
      5.      210
    18.     211
  7.   212
    1.     213
      1.      214
      2.      215
      3.      216
      4.      217
      5.      218
      6.      219
    2.     220
      1.      221
        1.       222
        2.       223
        3.       224
        4.       225
      2.      226
    3.     227
    4.     228
      1.      229
      2.      230
      3.      231
    5.     232
    6.     233
      1.      234
      2.      235
        1.       236
        2.       237
      3.      238
        1.       239
          1.        240
          2.        241
        2.       242
          1.        243
          2.        244
      4.      245
      5.      246
    7.     247
      1.      248
      2.      249
      3.      250
      4.      251
      5.      252
    8.     253
      1.      254
      2.      255
      3.      256
      4.      257
        1.       258
          1.        259
        2.       260
          1.        261
    9.     262
      1.      263
      2.      264
      3.      265
        1.       266
        2.       267
        3.       268
        4.       269
          1.        270
          2.        271
          3.        272
          4.        273
        5.       274
        6.       275
      4.      276
        1.       277
        2.       278
    10.     279
  8.   280
    1.     281
      1.      282
      2.      283
      3.      284
      4.      285
      5.      286
      6.      287
      7.      288
      8.      289
    2.     290
      1.      291
        1.       292
      2.      293
      3.      294
      4.      295
        1.       296
      5.      297
        1.       298
    3.     299
    4.     300
      1.      301
      2.      302
        1.       303
        2.       304
          1.        305
          2.        306
          3.        307
          4.        308
      3.      309
        1.       310
        2.       311
  9.   312
    1.     313
    2.     314
      1.      315
      2.      316
      3.      317
  10.   318
    1.     319
  11.   320
    1.     321

Changing the Compiler's Behavior with Options

Options control the operation of the compiler. This section provides a description of option conventions and an option summary table. It also provides detailed descriptions of the most frequently used options, including options used for type-checking and assembling.

For a help screen summary of the options, enter cl430 with no parameters on the command line.

The following apply to the compiler options:

  • There are typically two ways of specifying a given option. The "long form" uses a two hyphen prefix and is usually a more descriptive name. The "short form" uses a single hyphen prefix and a combination of letters and numbers that are not always intuitive.
  • Options are usually case sensitive.
  • Individual options cannot be combined.
  • An option with a parameter should be specified with an equal sign before the parameter to clearly associate the parameter with the option. For example, the option to undefine a constant can be expressed as --undefine=name. Likewise, the option to specify the maximum amount of optimization can be expressed as -O=3. You can also specify a parameter directly after certain options, for example -O3 is the same as -O=3. No space is allowed between the option and the optional parameter, so -O 3 is not accepted.
  • Files and options except the --run_linker option can occur in any order. The --run_linker option must follow all compiler options and precede any linker options.

You can define default options for the compiler by using the MSP430_C_OPTION environment variable. For a detailed description of the environment variable, see Section 2.4.1.

Table 2-8 through Table 2-30 summarize all options (including link options). Use the references in the tables for more complete descriptions of the options.

Table 2-1 Processor Options

Option Alias Effect Section
--silicon_version={msp|mspx} -v Selects the instruction set. Section 2.3.4
--code_model={small|large} Specifies the code memory model. Section 6.1.1
--data_model={small|large|
    restricted}
Specifies the data memory model. Section 6.1.2
--near_data={globals|none} Specifies what data must be near. Default is globals. Section 6.1.3

Table 2-2 Optimization Options(1)

Option Alias Effect Section
--opt_level=off Disables all optimization. Section 3.1
--opt_level=n -On Level 0 (-O0) optimizes register usage only (default if option not used).
Level 1 (-O1) uses Level 0 optimizations and optimizes locally.
Level 2 (-O2) uses Level 1 optimizations and optimizes globally.
Level 3 (-O3) uses Level 2 optimizations and optimizes the file.
Level 4 (-O4) uses Level 3 optimizations and performs link-time optimization.
Section 3.1, Section 3.3, Section 3.6
--opt_for_speed[=n] -mf Controls the tradeoff between size and speed (0-5 range). If this option is specified without n, the default value is 4. If this option is not specified, the default setting is 1. Section 3.2
Note: Machine-specific options (see Table 2-14) can also affect optimization.

Table 2-3 Advanced Optimization Options(1)

Option Alias Effect Section
--align_for_power Aligns all functions and loops to 4-byte boundaries. Power savings can be achieved if a small function or loop aligns to the 32-bit buffer for fetching code from flash memory. Power savings is less significant for larger functions and loops. --
--auto_inline=[size] -oi Sets automatic inlining size (--opt_level=3 only). If size is not specified, the default is 1. Section 3.5
--call_assumptions=n -opn Level 0 (-op0) specifies that the module contains functions and variables that are called or modified from outside the source code provided to the compiler.
Level 1 (-op1) specifies that the module contains variables modified from outside the source code provided to the compiler but does not use functions called from outside the source code.
Level 2 (-op2) specifies that the module contains no functions or variables that are called or modified from outside the source code provided to the compiler (default).
Level 3 (-op3) specifies that the module contains functions that are called from outside the source code provided to the compiler but does not use variables modified from outside the source code.
Section 3.4.1
--disable_inlining Prevents any inlining from occurring. Section 2.11
--fp_mode={relaxed|strict} Enables or disables relaxed floating-point mode. Section 2.3.3
--fp_reassoc={on|off} Enables or disables the reassociation of floating-point arithmetic. Section 2.3.3
--gen_opt_info=n -onn Level 0 (-on0) disables the optimization information file.
Level 1 (-on2) produces an optimization information file.
Level 2 (-on2) produces a verbose optimization information file.
Section 3.3.1
--optimizer_interlist -os Interlists optimizer comments with assembly statements. Section 3.11
--program_level_compile -pm Combines source files to perform program-level optimization. Section 3.4
--aliased_variables -ma Assumes variables are aliased Section 3.9
Note: Machine-specific options (see Table 2-14) can also affect optimization.

Table 2-4 Debug Options

Option Alias Effect Section
--symdebug:dwarf -g Default behavior. Enables symbolic debugging. The generation of debug information does not impact optimization. Therefore, generating debug information is enabled by default. Section 2.3.5
Section 3.12
--symdebug:dwarf_version=2|3|4 Specifies the DWARF format version. Section 2.3.5
--symdebug:none Disables all symbolic debugging. Section 2.3.5
Section 3.12
--symdebug:skeletal (Deprecated; has no effect.)

Table 2-5 Include Options

Option Alias Effect Section
--include_path=directory -I Adds the specified directory to the #include search path. Section 2.5.2.1
--preinclude=filename Includes filename at the beginning of compilation. Section 2.3.3

Table 2-6 ULP Advisor Options

Option Alias Effect Section
--advice:power[={all|none|rulespec}] Enables checking the specified ULP Advisor rules. (Default is all.) Section 2.3.3
--advice:power_severity={error|
    warning|remark|suppress}
Sets the diagnostic severity for ULP Advisor rules. Section 2.3.3

Table 2-7 Hardware Configuration Advisor Options

Option Alias Effect Section
--advice:hw_config[={all|none| rulespec} Enables checking the device configuration settings. (Default is none if this option is not included on the command line. Default is all if this option is used, but with no value specified.) Section 2.3.3

Table 2-8 Control Options

Option Alias Effect Section
--compile_only -c Disables linking (negates --run_linker). Section 4.1.3
--help -h Prints (on the standard output device) a description of the options understood by the compiler. Section 2.3.2
--run_linker -z Causes the linker to be invoked from the compiler command line. Section 2.3.2
--skip_assembler -n Compiles C/C++ source file, producing an assembly language output file. The assembler is not run and no object file is produced. Section 2.3.2

Table 2-9 Language Options

Option Alias Effect Section
--c89 Processes C files according to the ISO C89 standard. Section 5.16
--c99 Processes C files according to the ISO C99 standard. Section 5.16
--c11 Processes C files according to the ISO C11 standard. Section 5.16
--c++14 Processes C++ files according to the ISO C++14 standard.
The --c++03 option has been deprecated.
Section 5.16
--cpp_default -fg Processes all source files with a C extension as C++ source files. Section 2.3.7
--enum_type={uppacked|packed} Designates the underlying type of an enumeration type. Section 2.3.4
--exceptions Enables C++ exception handling. Section 5.9
--extern_c_can_throw Allow extern C functions to propagate exceptions. --
--float_operations_allowed
={none|all|32|64}
Restricts the types of floating point operations allowed. Section 2.3.3
--gen_cross_reference -px Generates a cross-reference listing file (.crl). Section 2.9
--pending_instantiations=# Specify the number of template instantiations that may be in progress at any given time. Use 0 to specify an unlimited number. Section 2.3.4
--plain_char={signed|unsigned} -mc Changes variables of type char from unsigned to signed. Default is unsigned. Section 2.3.4
--printf_support={nofloat|full|
    minimal}
Enables support for smaller, limited versions of the printf function family (sprintf, fprintf, etc.) and the scanf function family (sscanf, fscanf, etc.) run-time-support functions. Section 2.3.3
--relaxed_ansi -pr Enables relaxed mode; ignores strict ISO violations. This is on by default. To disable this mode, use the --strict_ansi option. Section 5.16.3
--rtti -rtti Enables C++ run-time type information (RTTI). –-
--strict_ansi -ps Enables strict ANSI/ISO mode (for C/C++, not for K&R C). In this mode, language extensions that conflict with ANSI/ISO C/C++ are disabled. In strict ANSI/ISO mode, most ANSI/ISO violations are reported as errors. Violations that are considered discretionary may be reported as warnings instead. Section 5.16.3

Table 2-10 Parser Preprocessing Options

Option Alias Effect Section
--preproc_dependency[=filename] -ppd Performs preprocessing only, but instead of writing preprocessed output, writes a list of dependency lines suitable for input to a standard make utility. Section 2.5.8
--preproc_includes[=filename] -ppi Performs preprocessing only, but instead of writing preprocessed output, writes a list of files included with the #include directive. Section 2.5.9
--preproc_macros[=filename] -ppm Performs preprocessing only. Writes list of predefined and user-defined macros to a file with the same name as the input but with a .pp extension. Section 2.5.10
--preproc_only -ppo Performs preprocessing only. Writes preprocessed output to a file with the same name as the input but with a .pp extension. Section 2.5.4
--preproc_with_comment -ppc Performs preprocessing only. Writes preprocessed output, keeping the comments, to a file with the same name as the input but with a .pp extension. Section 2.5.6
--preproc_with_compile -ppa Continues compilation after preprocessing with any of the -pp<x> options that normally disable compilation. Section 2.5.5
--preproc_with_line -ppl Performs preprocessing only. Writes preprocessed output with line-control information (#line directives) to a file with the same name as the input but with a .pp extension. Section 2.5.7

Table 2-11 Predefined Macro Options

Option Alias Effect Section
--define=name[=def] -D Predefines name. Section 2.3.2
--undefine=name -U Undefines name. Section 2.3.2

Table 2-12 Diagnostic Message Options

Option Alias Effect Section
--compiler_revision Prints out the compiler release revision and exits. --
--diag_error=num -pdse Categorizes the diagnostic identified by num as an error. Section 2.7.1
--diag_remark=num -pdsr Categorizes the diagnostic identified by num as a remark. Section 2.7.1
--diag_suppress=num -pds Suppresses the diagnostic identified by num. Section 2.7.1
--diag_warning=num -pdsw Categorizes the diagnostic identified by num as a warning. Section 2.7.1
--diag_wrap={on|off} Wrap diagnostic messages (default is on). Note that this command-line option cannot be used within the Code Composer Studio IDE.
--display_error_number -pden Displays a diagnostic's identifiers along with its text. Note that this command-line option cannot be used within the Code Composer Studio IDE. Section 2.7.1
--emit_warnings_as_errors -pdew Treat warnings as errors. Section 2.7.1
--gen_func_info_listing Generate user information file (.aux). Section 2.3.2
--issue_remarks -pdr Issues remarks (non-serious warnings). Section 2.7.1
--no_warnings -pdw Suppresses diagnostic warnings (errors are still issued). Section 2.7.1
--quiet -q Suppresses progress messages (quiet). --
--set_error_limit=num -pdel Sets the error limit to num. The compiler abandons compiling after this number of errors. (The default is 100.) Section 2.7.1
--super_quiet -qq Super quiet mode. --
--tool_version -version Displays version number for each tool. --
--verbose Display banner and function progress information. --
--verbose_diagnostics -pdv Provides verbose diagnostic messages that display the original source with line-wrap. Note that this command-line option cannot be used within the Code Composer Studio IDE. Section 2.7.1
--write_diagnostics_file -pdf Generates a diagnostic message information file. Compiler only option. Note that this command-line option cannot be used within the Code Composer Studio IDE. Section 2.7.1

Table 2-13 Supplemental Information Options

Option Alias Effect Section
--gen_preprocessor_listing -pl Generates a raw listing file (.rl). Section 2.10
--section_sizes={on|off} Generates section size information, including sizes for sections containing executable code and constants, constant or initialized data (global and static variables), and uninitialized data. (Default is off if this option is not included on the command line. Default is on if this option is used with no value specified.) Section 2.7.1

Table 2-14 Run-Time Model Options

Option Alias Effect Section
--common={on|off} On by default. When on, uninitialized file scope variables are emitted as common symbols. When off, common symbols are not created. Section 2.3.4
--disable_interrupts_around_hw_mpy=off Setting this option to off leaves interrupts enabled during inlined hardware multiply operations. This option can only be used if all ISRs do not use multiplication or call other functions. Section 2.3.4
--gen_data_subsections={on|off} Place all aggregate data (arrays, structs, and unions) into subsections. This gives the linker more control over removing unused data during the final link step. The default is on. Section 4.2.2
--global_register={r4|r5} Reserves register for use by user.
--large_memory_model -ml Uses a large memory model when compiling for the MSP430X. (Deprecated) Section 2.3.4
--ramfunc={on|off} If set to on, specifies that all functions should be placed in the .TI.ramfunc section, which is placed in RAM. Section 2.3.4
--silicon_errata={errata} Generates code to work around the specified silicon errata. The errata value may be CPU12, CPU13, CPU15, CPU18, CPU19, CPU21, CPU22, CPU23, or CPU40. See the corresponding device errata sheet for details.
--use_hw_mpy[={16|32|F5|none}] If --opt_for_speed is set to 1 or higher, replaces all references to the default integer/long multiply routine with the version of the multiply routine that uses the hardware multiplier support. Additionally, if --opt_for_speed is set to 4 or 5, hardware multiplication is inlined during code generation. Section 2.3.4

Table 2-15 Entry/Exit Hook Options

Option Alias Effect Section
--entry_hook[=name] Enables entry hooks. Section 2.14
--entry_parm={none|name|
    address}
Specifies the parameters to the function to the --entry_hook option. Section 2.14
--exit_hook[=name] Enables exit hooks. Section 2.14
--exit_parm={none|name|address} Specifies the parameters to the function to the --exit_hook option. Section 2.14
--remove_hooks_when_inlining Removes entry/exit hooks for auto-inlined functions. Section 2.14

Table 2-16 Feedback Options

Option Alias Effect Section
--analyze=codecov Generate analysis info from profile data. Section 3.8.2.2
--analyze_only Only generate analysis. Section 3.8.2.2
--gen_profile_info Generates instrumentation code to collect profile information. Section 3.7.1.3
--use_profile_info=file1[, file2,...] Specifies the profile information file(s). Section 3.7.1.3

Table 2-17 Assembler Options

Option Alias Effect Section
--keep_asm -k Keeps the assembly language (.asm) file. Section 2.3.11
--asm_listing -al Generates an assembly listing file. Section 2.3.11
--c_src_interlist -ss Interlists C source and assembly statements. Section 2.12
Section 3.11
--src_interlist -s Interlists optimizer comments (if available) and assembly source statements; otherwise interlists C and assembly source statements. Section 2.3.2
--absolute_listing -aa Enables absolute listing. Section 2.3.11
--asm_define=name[=def] -ad Sets the name symbol. Section 2.3.11
--asm_dependency -apd Performs preprocessing; lists only assembly dependencies. Section 2.3.11
--asm_includes -api Performs preprocessing; lists only included #include files. Section 2.3.11
--asm_undefine=name -au Undefines the predefined constant name. Section 2.3.11
--asm_listing_cross_reference -ax Generates the cross-reference file. Section 2.3.11
--include_file=filename -ahi Includes the specified file for the assembly module. Section 2.3.11

Table 2-18 File Type Specifier Options

Option Alias Effect Section
--asm_file=filename -fa Identifies filename as an assembly source file regardless of its extension. By default, the compiler and assembler treat .asm files as assembly source files. Section 2.3.7
--c_file=filename -fc Identifies filename as a C source file regardless of its extension. By default, the compiler treats .c files as C source files. Section 2.3.7
--cpp_file=filename -fp Identifies filename as a C++ file, regardless of its extension. By default, the compiler treats .C, .cpp, .cc and .cxx files as a C++ files. Section 2.3.7
--obj_file=filename -fo Identifies filename as an object code file regardless of its extension. By default, the compiler and linker treat .obj files as object code files, including both *.c.obj and *.cpp.obj files. Section 2.3.7

Table 2-19 Directory Specifier Options

Option Alias Effect Section
--abs_directory=directory -fb Specifies an absolute listing file directory. By default, the compiler uses the object file directory. Section 2.3.10
--asm_directory=directory -fs Specifies an assembly file directory. By default, the compiler uses the current directory. Section 2.3.10
--list_directory=directory -ff Specifies an assembly listing file and cross-reference listing file directory By default, the compiler uses the object file directory. Section 2.3.10
--obj_directory=directory -fr Specifies an object file directory. By default, the compiler uses the current directory. Section 2.3.10
--output_file=filename -fe Specifies a compilation output file name; can override --obj_directory. Section 2.3.10
--pp_directory=dir Specifies a preprocessor file directory. By default, the compiler uses the current directory. Section 2.3.10
--temp_directory=directory -ft Specifies a temporary file directory. By default, the compiler uses the current directory. Section 2.3.10

Table 2-20 Default File Extensions Options

Option Alias Effect Section
--asm_extension=[.]extension -ea Sets a default extension for assembly source files.

Section 2.3.9
--c_extension=[.]extension -ec Sets a default extension for C source files. Section 2.3.9
--cpp_extension=[.]extension -ep Sets a default extension for C++ source files. Section 2.3.9
--listing_extension=[.]extension -es Sets a default extension for listing files. Section 2.3.9
--obj_extension=[.]extension -eo Sets a default extension for object files. Section 2.3.9

Table 2-21 Command Files Options

Option Alias Effect Section
--cmd_file=filename -@ Interprets contents of a file as an extension to the command line. Multiple -@ instances can be used. Section 2.3.2

Table 2-22 MISRA-C 2004 Options

Option Alias Effect Section
--check_misra[={all|required|
    advisory|none|rulespec}]
Enables checking of the specified MISRA-C:2004 rules. Default is all. Section 2.3.3
--misra_advisory={error|warning|
    remark|suppress}
Sets the diagnostic severity for advisory MISRA-C:2004 rules. Section 2.3.3
--misra_required={error|warning|
    remark|suppress}
Sets the diagnostic severity for required MISRA-C:2004 rules. Section 2.3.3