Skip to main content

IAR Embedded Workbench for Arm 9.70.x

Summary of compiler options

In this section:

This table summarizes the compiler command line options:

Command line option

Description

‑‑aapcs

Specifies the calling convention

‑‑aarch64

Generates code using the A64 instruction set

‑‑abi

Specifies a data model for generating code using the A64 instruction set

‑‑aeabi

Enables AEABI-compliant code generation

‑‑align_sp_on_irq

Generates code to align SP on entry to __irq functions

‑‑arm

Sets the default function mode to Arm

‑‑branch__protection

Generates code with support for branch protection using BTI, PAC, or both

‑‑c89

Specifies the C89 dialect

‑‑char_is_signed

Treats char as signed

‑‑char_is_unsigned

Treats char as unsigned

‑‑cmse

Enables CMSE secure object generation

‑‑cpu

Specifies a processor variant

‑‑cpu_mode

Specifies the default CPU mode for functions

‑‑c++

Specifies Standard C++

-D

Defines preprocessor symbols

‑‑debug

Generates debug information

‑‑dependencies

Lists file dependencies

‑‑deprecated_feature_warnings

Enables/disables warnings for deprecated features

‑‑diag_error

Treats these as errors

‑‑diag_remark

Treats these as remarks

‑‑diag_suppress

Suppresses these diagnostics

‑‑diag_warning

Treats these as warnings

--diagnostics_format

Specifies the format for printed diagnostics

‑‑diagnostics_tables

Lists all diagnostic messages

‑‑discard_unused_publics

Discards unused public symbols

‑‑dlib_config

Uses the system include files for the DLIB library and determines which configuration of the library to use

‑‑do_explicit_zero_opt_in_named_sections

For user-named sections, treats explicit initializations to zero as zero initializations

--dynamic_output

Lists in a structured format all output files

-e

Enables IAR language extensions

‑‑enable_hardware_workaround

Enables a specific hardware workaround

‑‑enable_restrict

Enables the Standard C keyword restrict

‑‑endian

Specifies the byte order of the generated code and data

‑‑enum_is_int

Sets the minimum size on enumeration types

‑‑error_limit

Specifies the allowed number of errors before compilation stops

-f

Extends the command line

‑‑f

Extends the command line, optionally with a dependency

‑‑fpu

Selects the type of floating-point unit

--function_sections

Places each function of the source file in a separate section in the resulting object file

‑‑generate_entries_without_bounds

Generates extra functions for use from non-instrumented code. See Compiler and linker reference for C-RUN

‑‑guard_calls

Enables guards for function static variable initialization

‑‑header_context

Lists all referred source files and header files

-I

Specifies include file path

‑‑ignore_uninstrumented_pointers

Disables checking of accesses via pointers from non-instrumented code. See Compiler and linker reference for C-RUN

-l

Creates a list file

‑‑language

Enables IAR or GNU language extensions

‑‑libc++

Makes the compiler and linker use the Libc++ library

‑‑lock_regs

Prevents the compiler from using specified registers

‑‑macro_positions_in _diagnostics

Obtains positions inside macros in diagnostic messages

‑‑make_all_definitions_weak

Turns all variable and function definitions into weak definitions

‑‑max_cost_constexpr_call

Specifies the limit for constexpr evaluation cost

‑‑max_depth_constexpr_call

Specifies the limit for constexpr recursion depth

‑‑mfc

Enables multi-file compilation

‑‑no_alignment_reduction

Disables alignment reduction for simple Thumb functions

‑‑no_auto_ro_placement

Disables an optimization that places some variables in read-only memory

‑‑no_bom

Omits the Byte Order Mark for UTF-8 output files

‑‑no_call_frame_info

Disables output of call frame information

‑‑no_clustering

Disables static clustering optimizations

‑‑no_code_motion

Disables code motion optimization

‑‑no_const_align

Disables the alignment optimization for constants

‑‑no_cse

Disables common subexpression elimination

‑‑no_default_fp_contract

Sets the default value for STDC FP_CONTRACT to OFF

‑‑no_exceptions

Disables C++ exception support

‑‑no_fragments

Disables section fragment handling

‑‑no_inline

Disables function inlining

‑‑no_literal_pool

Generates code that should run from a memory region where it is not allowed to read data, only to execute code

‑‑no_loop_align

Disables the alignment of labels in loops

‑‑no_mem_idioms

Makes the compiler not optimize certain memory access patterns

‑‑no_normalize_file_macros

Disables normalization of paths in the symbols __FILE__ and __BASE_FILE__

‑‑no_path_in_file_macros

Removes the path from the return value of the symbols __FILE__ and __BASE_FILE__

‑‑no_rtti

Disables C++ RTTI support

‑‑no_rw_dynamic_init

Disables runtime initialization of static C variables

‑‑no_scheduling

Disables the instruction scheduler

‑‑no_size_constraints

Relaxes the normal restrictions for code size expansion when optimizing for speed

‑‑no_static_destruction

Disables destruction of C++ static variables at program exit

‑‑no_system_include

Disables the automatic search for system include files

‑‑no_tbaa

Disables type-based alias analysis

‑‑no_typedefs_in_diagnostics

Disables the use of typedef names in diagnostics

‑‑no_unaligned_access

Avoids unaligned accesses

‑‑no_uniform_attribute_syntax

Specifies the default syntax rules for IAR type attributes

‑‑no_unroll

Disables loop unrolling

‑‑no_var_align

Aligns variable objects based on the alignment of their type

‑‑no_warnings

Disables all warnings

‑‑no_wrap_diagnostics

Disables wrapping of diagnostic messages

‑‑nonportable_path_warnings

Generates a warning when the path used for opening a source header file is not in the same case as the path in the file system

-O

Sets the optimization level

-o

Sets the object filename. Alias for ‑‑output

‑‑only_stdout

Uses standard output only

‑‑output

Sets the object filename

‑‑pending_instantiations

Sets the maximum number of instantiations of a given C++ template

‑‑predef_macros

Lists the predefined symbols.

‑‑preinclude

Includes an include file before reading the source file

‑‑preprocess

Generates preprocessor output

‑‑public_equ

Defines a global named assembler label

-r

Generates debug information. Alias for ‑‑debug

‑‑relaxed_fp

Relaxes the rules for optimizing floating-point expressions

‑‑remarks

Enables remarks

‑‑require_prototypes

Verifies that functions are declared before they are defined

‑‑ropi

Generates code that usesPC-relative references to access code and read-only data

‑‑ropi_cb

Makes all accesses to constant data, base-addressed relative to the register R8

‑‑runtime_checking

Enables runtime error checking. See Compiler and linker reference for C-RUN

‑‑rwpi

Generates code that uses an offset from the static base register to address-writable data

‑‑rwpi_near

Generates code that uses an offset from the static base register to address-writable data. Addresses max 64 Kbytes of memory

‑‑section

Changes a section name

‑‑section_prefix

Adds a prefix to section names

‑‑shared

See ‑‑shared (compiler option)

‑‑silent

Sets silent operation

‑‑source_encoding

Specifies the encoding for source files

‑‑stack_protection

Enables stack protection

‑‑strict

Checks for strict compliance with Standard C/C++

‑‑system_include_dir

Specifies the path for system include files

‑‑text_out

Specifies the encoding for text output files

‑‑thumb

Sets default function mode to Thumb

‑‑uniform_attribute_syntax

Specifies the same syntax rules for IAR type attributes as for const and volatile

‑‑use_c++_inline

Uses C++ inline semantics in C

‑‑use_paths_as_written

Use paths as written in debug information

‑‑use_unix_directory_separators

Uses / as directory separator in paths

‑‑utf8_text_in

Uses the UTF-8 encoding for text input files

‑‑vectorize

Enables generation of NEON vector instructions

‑‑version

Sends compiler output to the console and then exits

‑‑visibility

See ‑‑visibility

‑‑vla

Enables VLA support

‑‑warn_about_c_style_casts

Makes the compiler warn when C-style casts are used in C++ source code

‑‑warn_about_incomplete_constructors

Makes the compiler warn about constructors that do not initialize all members

‑‑warn_about_missing_field_initializers

Makes the compiler warn about fields without explicit initializers

‑‑warnings_affect_exit_code

Warnings affect exit code

‑‑warnings_are_errors

Warnings are treated as errors

Table 95. Compiler options summary