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.

An option with the description of [Professional Edition only] can be used only in the Professional Edition.

Table 2.2

Compile Options

Classification

Option

Description

Version/help display specification

-V

This option displays the version information of ccrl.

-help

This option displays the descriptions of ccrl options.

Output file specification

-o

This option specifies the output file name.

-obj_path

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

-asm_path

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

-prep_path

This option specifies the folder to save the preprocessed C source file.

Source debugging control

-g

This option outputs information for source debugging.

-g_line [V1.02 or later]

This option enhances information for source debugging at optimization.

Device specification relation

-cpu

This option specifies the type of the CPU core.

-use_mda

This option specifies whether to use the arithmetic unit.

Language standard specification

-lang [V1.06 or later]

This option specifies the language standard of the C source file.

Processing interrupt specification

-P

This option executes only 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.

-U

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

-I

This option specifies the folder to search header files.

-preinclude

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

-preprocess

This option controls outputting the result of preprocessing.

Memory model

-memory_model

This option specifies the type of the memory model when compiling.

-far_rom

This option sets the default near/far attribute of ROM data to far.

Optimization

-O

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

-goptimize

This option generates the information for inter-module
optimization.

Error output control

-no_warning_num

This option suppresses outputting warning messages of the specified number.

-change_message [V1.06 or later]

This option changes the message level.

-error_file

This option outputs all compiler error messages together to a file.

Additional information output

-cref

This option outputs the static analysis information file.

-pass_source

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

Code generation changing

-dbl_size

This option changes the interpretation of the double and long double types.

-signed_char

This option specifies that a char type without a signed or unsigned specifier is handled as a signed type.

-signed_bitfield

This option specifies that a bit field of a type without a signed or unsigned specifier is handled as a signed type.

-switch

This option specifies the format in which the code of switch statements is to be output.

-volatile

External variables and the variables specified with "#pragma address" are handled as if they were volatile-declared.

-merge_string

This option merges string literals.

-pack

This option sets 1 as the number of alignment for a structure member.

-stack_protector/-stack_protector_all [Professional Edition only] [V1.02 or later]

This option generates a code for detection of stack smashing.

-control_flow_integrity [Professional Edition only] [V1.06 or later]

This option generates code for the detection of illegal indirect function calls.

-insert_nop_with_label [V1.05 or later]

This option inserts a local label and nop instruction.

Function expansion

-strict_std [V1.06 or later] / -ansi [V1.05 or earlier]

The C source program is processed in strict compliance with the language standard which is specified with the -lang option.

-refs_without_declaration

An error is generated upon reference of an undeclared
function or a function that does not have a prototype
declaration.

-large_variable

This option sets the maximum size of a variable to 0xffff bytes.

-nest_comment

This option enables nesting of /* */ comments.

-character_set

This option specifies the Japanese/Chinese character code.

MISRA check

-misra2004 [Professional Edition only]

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

-misra2012 [Professional Edition only] [V1.02 or later]

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

-ignore_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.

-check_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.

Subcommand file specification

-subcommand

This option specifies a subcommand file.

Assembler and linker control

-asmopt

This option specifies assemble options.

-lnkopt

This option specifies link options.

-asmcmd

This option specifies the use of a subcommand file to specify the assemble options to be passed to the assembler.

-lnkcmd

This option specifies the use of a subcommand file to specify the link options to be passed to the optimizing linker.

-dev

This option specifies the device file that the assembler and optimizing linker use.

Compiler transition support

-convert_cc

This option supports transition of programs written for other compilers.

-unaligned_pointer_for_ca78k0r [V1.06 or later]

Indirect references by pointers are accessed in 1-byte units.