2.5.1 Compile options

This section explains options for the compile phase.

 

Caution about options are shown below.

-

Uppercase characters and lowercase characters are distinguished for options.

-

When numerical values are specified as parameters, decimal or hexadecimal numbers which starts with "0x" ("0X") can be specified.
Uppercase characters and lowercase characters are not distinguished for the alphabet of hexadecimal numbers.

-

When a file name is specified as a parameter, it can include the path (absolute path or relative path).
When a file name without the path or a relative path is specified, the reference point of the path is the current folder.

-

When a parameter includes a space (such as a path name), enclose the parameter in a pair of double quotation marks (").

 

The types and explanations for options are shown below.

Table 2.2

Compile Options

Classification

Option

Description

Version/help display specification

-V

This option displays the version information of ccrh.

-h

This option displays the descriptions of ccrh options.

Output file specification

-o

This option specifies the output file name.

-Xobj_path

This option specifies the folder to save an object file generated during compilation.

-Xasm_path

This option specifies the folder to save an assembly source file generated during compilation.

-Xprep_path

This option specifies the folder to save the preprocessed file.

Source debugging control

-g

This option outputs information for source debugging.

Device specification

-Xcommon

This option specifies that an object file common to the various devices is generated.

-Xcpu

This option specifies that an object for the specified core is generated.

Processing interrupt specification

-P

This option executes only preprocess processing for the input file.

-S

This option does not execute processing after assembling.

-c

This option does not execute processing after linking.

Preprocessor control

-D

This option defines preprocessor macros and assembler symbols.

-U

This option deletes the definition of the preprocessor macro or assembler symbol by the -D option.

-I

This option specifies the folder to search include files.

-Xpreinclude

This option specifies the file that is included at the top of the compilation unit.

-Xpreprocess

This option controls outputting the result of preprocessing.

C language control

-Xansi

This option processes as making C source program comply strictly with the ANSI standard.

-Xenum_type

This option specifies which integer type the enumeration type handles.

-Xvolatile

This option specifies external variables as volatile.

-Xcheck

This option checks the compatibility of a C source file.

-Xmisra2004 [Professional Edition only]

This option checks source code against the MISRA-C: 2004 rules.

-Xmisra2012 [Professional Edition only]

This option checks source code against the MISRA-C: 2012 rules.

-Xignore_files_misra [Professional Edition only]

This option specifies files that will not be checked against the MISRA-C: 2004 rules or MISRA-C: 2012 rules.

-Xcheck_language_extension [Professional Edition only]

This option enables the source-code checking of the MISRA-C: 2004 rules or MISRA-C: 2012 rules, which are partially suppressed by the extended language specifications.

Japanese/Chinese character control

-Xcharacter_set

This option specifies the Japanese/Chinese character code.

Optimization specification

-O

This option specifies the optimization level or the details of each optimization items.

-Xintermodule

This option performs inter-module optimization.

-Xinline_strcpy

This option performs inline expansion of standard library functions "strcpy", "strcmp", "memcpy", and "memset" calls.

-Xmerge_string

This option merges string literals.

-Xalias

This option performs optimization with consideration for the type of the data indicated by the pointer.

-Xmerge_files

This option merges two or more C source files and compiles them.

-Xwhole_program

This option performs optimization assuming that the files to be compiled comprise the entire program.

Generated code control

-Xpack

This option performs the structure packing.

-Xbit_order

This option specifies the order of bit-field members.

-Xpass_source

This option outputs a C source program as a comment to the assembly source file.

-Xswitch

This option specifies a mode in which the code of a switch statement is to be output.

-Xreg_mode

This option specifies the register mode.

-Xreserve_r2

This option reserves the r2 register.

-Xep

This option specifies how to handle the ep register.

-Xfloat

This option controls generating floating-point calculation instructions.

-Xcall_jump

This option controls generating function-call branch instructions.

-Xfar_jump

This option controls outputting far jump.

-Xdiv

This option generates the div and divu instructions for division.

-Xcheck_div_ov

This option checks the OV flag at division.

-Xuse_fmaf

This option generates product-sum operation instructions.

-Xunordered_cmpf

This option detects invalid operation exceptions in floating-point comparison.

-Xmulti_level

This option specifies the generation of a multi-core program.

-Xpatch

This option applies a patch.

-Xdbl_size

This option specifies the data size of double and long double type.

-Xround

This option specifies the mode for rounding floating-point constants.

-Xalign4

This option specifies the alignment value for branch destination addresses.

-Xstack_protector/-Xstack_protector_all [Professional Edition only]

This option generates a code for detection of stack smashing.

-Xsection

This option specifies the default sections for data.

-Xcheck_exclusion_control [V1.04.00 or later]

This option enables checking of exclusive control.

Information file output control

-Xcref

This option outputs the static analysis information file.

Error output control

-Xerror_file

This option outputs error messages to a file.

Warning message output control

-Xno_warning

This option suppresses outputting warning messages of the specified number.

Phase individual option specification

-Xasm_option

This option specifies assemble options.

-Xlk_option

This option specifies link options.

Subcommand file specification

@

This option specifies a subcommand file.