JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 9.2p0 | CONFIDENTIAL | CodeSecure Inc |
CodeSonar provides four Renesas compiler models.
| Compiler model |
Modeled native compiler | Source file extensions | Description |
|---|---|---|---|
| ccrx | ccrx | any, including no file extension | Renesas C/C++ compiler for RX Family |
| ch38 | ch38 | .c, .C, .i, cc, cpp, cxx, c++, ii | Renesas C/C++ compiler for H8S, H8/300 Series |
| shc | shc | .c, .C, .i, cc, cpp, cxx, c++, ii |
Renesas C/C++ compilers for the SuperH RISC engine family.
Before version 5.0, shc compiled source files as C and shcpp compiled source files as C++. From version 5.0, shc switches language based on source file suffix (and shcpp is no longer documented, but is still available). If you are using a pre-5.0 Renesas SuperH compiler, you will need to use a special-format ABI key to instruct the shc compiler model to treat source files as C. |
| shcpp | shcpp | .c, .C, .i, cc, cpp, cxx, c++, ii |
| Platform Availability | The ccrx, ch38, shc, and shcpp compiler models are available as follows.
|
|||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Default Recognition/Handling | By default, compilations
are recognized and handled as follows.
|
|||||||||||||||
| Specifying Additional Mappings | If your compiler executable has a different name, specify a corresponding COMPILER_MODELS rule to map your executable name to the ccrx, ch38, shc, or shcpp model. |
For full details of all native compilers recognized by CodeSonar by default, see section Compilers Recognized by CodeSonar.
The ch38, shc, and shcpp compiler models all share the same ABI key format; the ccrx model has its own separate format.
The model-specific ABI key format for the ccrx compiler model is:
as
If an ABI key with this format is specified for a compilation that is modeled with one of these compiler model, the following settings will be applied.
The model-specific ABI key format for the ch38, shc, and shcpp compiler models is:
as
If an ABI key with this format is specified for a compilation that is modeled with one of these compiler model, the following settings will be applied.
Suppose we are want to instruct the shc compiler model to treat source files as C, and to specify that both Renesas version and Hitachi version are 0x602. Then we add the following rule to the configuration file.
COMPILER_MODELS += /path/to/shc.exe -> shc:0x602.0x602.1
For more information, see Compiler Models: ABI Keys.
The following tables list options that receive additional treatment in the Renesas compiler models. Options not mentioned in this section are ignored.
| Argument | Alias (except ccrx) |
Additional Treatment in Model | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
All Renesas Models |
||||||||||||
| -define=m[,m2,...] | -def | Defines macro m (m2,...) to 1. | ||||||||||
| -define=m=def[,m2=def2,...] | -def |
Defines macro m with def as its definition (m2 with def2 as its definition, ...). | ||||||||||
| -endian=val | -en |
|
||||||||||
| -exception | -ex | Specifies front end option --exceptions unless the command line
subsequently contains -noex,
/noex, -noexception, or /noexception. (In all other cases, specifies
--no_exceptions.) The ccrx model also specifies front end option --no_exceptions if both -exception and -lang=ecpp are specified. |
||||||||||
| -include=dlist | -i | For each directory dir in the comma-separated string dlist, specifies front end option -Idir. | ||||||||||
| -preinclude=dlist | -prei | For each directory dir in the comma-separated string dlist, specifies front end option --preincludedir. | ||||||||||
| -subcommand=file | -su -sub |
Extracts the options specified in file and appends them to the command line. | ||||||||||
ch38, shc and shcpp Models Only (i.e. not ccrx) |
||||||||||||
| -code=asm -code=asmcode |
-c | Specifies front end option --asm_functions. | ||||||||||
| -double=val | -do |
If val is f or
float, defines macro
__FLT__.
For SuperH compilers, also defines macro _FLT. |
||||||||||
| -dspc | -ds |
Specifies front end options --add_named_address_space=__X,
--add_named_address_space=__Y, and
--cs_dspc, unless
there is a subsequent occurrence of -ecpp.
For SuperH compilers, also defines macro _DSPC. |
||||||||||
| -ecpp | -ec | Specifies front end option --embedded_c++, unless there is a subsequent occurrence of -dspc. | ||||||||||
| -pack=val | (n/a) |
If val is nonempty, specifies front end option --pack_alignment val. | ||||||||||
| -sjis | -sj |
Specifies front end options --multibyte_chars and --cs_sjis unless the command line
subsequently contains one of the following:
|
||||||||||
| -string=s | -st |
If s is d or data, specifies --no_const_string_literals. (In all other cases, specifies --const_string_literals.) | ||||||||||
| -template=timode |
-t |
Specifies front end option --instantiate mode where
mode is:
|
||||||||||
ccrx Model Only |
||||||||||||
| -auto_enum | Defines macro __AUTO_ENUM=1. | |||||||||||
| -big5 | Specifies front end option --multibyte_chars unless the command line subsequently contains -utf8. | |||||||||||
| -bit_order=val | If val is left,
defines macro __BITLEFT=1. If val is right, or this flag is not specified, defines macro __BITRIGHT=1. If there are multiple -bit_order settings, only the last one applies. |
|||||||||||
| -cpu=val | If val is rx200,
defines macro __RX200=1 If val is rx600, defines macro __RX600=1. If there are multiple -cpu settings, only the last one applies. If both -cpu and -isa are specified, CodeSonar will not build a project or generate any internal representation. If both -cpu=rx200 and -fpu are specified, CodeSonar will not build a project or generate any internal representation. |
|||||||||||
| -dbl_size=val | If val is 8, defines
macro __DBL8=1 and
specifies front end options --cs_targ_sizeof_double 8 and --cs_targ_sizeof_long_double 8. If val is 4, or this flag is not specified, defines macro __DBL4=1 and specifies front end options --cs_targ_sizeof_double 4 and --cs_targ_sizeof_long_double 4. If there are multiple -dbl_size settings, only the last one applies. If val has any other value, CodeSonar will not build a project or generate any internal representation. |
|||||||||||
| -denormalize=val | If val is on, defines
macro __DON=1. If val is off, or this flag is not specified, defines macro __DOFF=1. If there are multiple -denormalize settings, only the last one applies. |
|||||||||||
| -euc | Specifies front end option --multibyte_chars unless the command line subsequently contains -utf8. | |||||||||||
| -fpu |
Unless there is a subsequent occurrence of -nofpu:
|
|||||||||||
| -gb2312 | Specifies front end option --multibyte_chars unless the command line subsequently contains -utf8. | |||||||||||
| -isa=val | If val is rxv1,
defines macro __RXV1=1. If val is rxv2, defines macro __RXV2=1. If there are multiple -isa settings, only the last one applies. If both -cpu and -isa are specified, CodeSonar will not build a project or generate any internal representation. |
|||||||||||
| -int_to_short | Defines macro __INT_SHORT=1 and specifies front end option --cs_targ_sizeof_int 2. | |||||||||||
| -lang=val | If val is c, compiles
as C (regardless of file extension) and defines macro
__STDC_VERSION__=199409L. If val is c99, compiles as C (regardless of file extension) and specifies front end option --c99. If val is cpp, compiles as C++ (regardless of file extension). If val is ecpp, compiles as C++ (regardless of file extension) specifies front end option --embedded_c++ If there are multiple -lang settings, only the last one applies. |
|||||||||||
| -latin1 | Specifies front end option --multibyte_chars unless the command line subsequently contains -utf8. | |||||||||||
| -library=val | If val is function,
defines macro __FUNCTION_LIB=1. If val is intrinsic, or this flag is not specified, defines macro __INTRINSIC_LIB=1. If there are multiple -library settings, only the last one applies. If val has any other value, CodeSonar will not build a project or generate any internal representation. |
|||||||||||
| -nofpu | Cancels the effect of a previous occurrence of -fpu. | |||||||||||
| -nouse_pid_register | No effect unless -pid is also specified, in which case CodeSonar will not build a project or generate any internal representation. | |||||||||||
| -pack | Specifies front end option --pack_alignment 1 unless the command line subsequently contains -unpack. | |||||||||||
| -pic | Defines macro __PIC=1. | |||||||||||
| -pid -pid=val |
Defines macro __PID=1 unless -nouse_pid_register is also specified, in which case CodeSonar will not build a project or generate any internal representation. | |||||||||||
| -round=val | If val is zero,
defines macro __ROZ=1. If val is nearest, or this flag is not specified, defines macro __RON=1. If there are multiple -round settings, only the last one applies. |
|||||||||||
| -rtti=val | If val is on,
specifies front end option --rtti unless -lang=ecpp is also specified. If val is on but -lang=ecpp is also specified, specifies front end option --no_rtti . If val is off, or this flag is not specified, specifies front end option --no_rtti. If there are multiple -rtti settings, only the last one applies. |
|||||||||||
| -signed_bitfield | Defines macro __SBIT=1 and specifies front end option --signed_bit_fields, unless the command line subsequently contains -unsigned_bitfield. | |||||||||||
| -signed_char | Defines macro __SCHAR=1 and specifies front end option --signed_chars, unless the command line subsequently contains -unsigned_char. | |||||||||||
| -sjis | Specifies front end option --multibyte_chars unless the command line subsequently contains -utf8. | |||||||||||
| -subcommand=fname | Read additional arguments out of file fname and append to the argument list for processing. | |||||||||||
| -undefine=m[,m2,...] | Undefines macros m (m2,...). | |||||||||||
| -unpack | Cancels the effect of a previous occurrence of -pack. | |||||||||||
| -unsigned_bitfield | Defines macro __UBIT=1 and specifies front end option --unsigned_bit_fields, unless the command line subsequently contains -signed_bitfield. | |||||||||||
| -unsigned_char | Defines macro __UCHAR=1 and specifies front end option --unsigned_chars, unless the command line subsequently contains -signed_char. | |||||||||||
| -utf8 | Specifies front end option --unicode_source_kind UTF-8 unless the command line subsequently contains -sjis, -euc, -latin1, -big5, or -gb2312. | |||||||||||
ch38 Model Only |
||||||||||||
| -abs16 | (n/a) | Defines macro __ABS16__. | ||||||||||
| -byteenum | -b | Specifies front end option --short_enums and defines macro __BENM__. | ||||||||||
| -cpu=mode[:bitw][:md] | -cp |
Defines several macros. Click a macro name for information
about its definition.
|
||||||||||
| -cpuexpand[=val] | -cpue | Defines macro __CPUEX__. | ||||||||||
| -lang=val | -lan | Sets compilation mode to C if val is c, C++ otherwise (including c99). If val is val, also defines macro __STDC_VERSION__=199901L. | ||||||||||
| -library=ltype | -lib | If ltype is i or intrinsic, defines macro __INTRINSIC_LIB__. | ||||||||||
| -pack=val | -pa |
Specifies front end option --pack_alignment val. | ||||||||||
| -ptr16 | (n/a) | Defines macro __DATA_ADDRESS_SIZE__ to 2. | ||||||||||
| -rtti=on | -rt | Specifies front end option --rtti. (In all other cases, specifies --no_rtti.) | ||||||||||
| -ws=file | (n/a) | Extracts the options specified in file and appends them to the command line. | ||||||||||
shc and shcpp Models Only |
||||||||||||
| -auto_enum | -au | Specifies front end option --short_enums. | ||||||||||
| -cpu=mode | -cp | Defines macro _MODE, where MODE is the upper-case version of mode. | ||||||||||
| -denormalize=on | -den | Defines macro _DON. | ||||||||||
| -fixed_const | -fixed_c | Defines macro _FXD. | ||||||||||
| -fpu=val | -fp |
If val is s or
single, defines macro
_FPS.
If val is d or double, defines macro _FPD. |
||||||||||
| -lang=val | -la | Sets compilation mode to C if val is c, C++ otherwise (including c99). | ||||||||||
| -pic=1 | -p | Defines macro _PIC. | ||||||||||
| -round=val | -r | If val is n or nearest, defines macro _RON. | ||||||||||
| -rtti=on | (n/a) | Specifies front end option --rtti. (In all other cases, specifies --no_rtti.) | ||||||||||
If any of the following are specified, CodeSonar will ignore the compilation and will not generate any corresponding internal representation. If a CodeSonar project is based only on ignored compilations, it will have no contents and so will not be finalized.
| ch38, shc, shcpp | ccrx |
|---|---|
| -prep (/prep, -preprocessor, /preprocessor) | -output=outputtype[=filename] for any outputtype except src, obj, abs, hex, or sty |
| n/a | Both -cpu and -isa are specified. |
| n/a | Neither -cpu nor -isa is specified. |
| n/a | Both -cpu=rx200 and -fpu are specified. |
| n/a | Both -pid and -nouse_pid_register are specified. |
| n/a | -endian=val for any val except big, little |
| n/a | Any ccrx-only flag is specified with an argument other than those explicitly noted in the table above. |
The modeled compilation mode depends on the modeled build command and the special-format ABI key associated with the compilation (if any).
| Compiler Model | File Extensions | |
|---|---|---|
| C Mode | C++ Mode | |
| ccrx | .c, .C | .cc, .cp, .cpp (all case-insensitive) |
| ch38, shc, shcpp | .c, .C, .i | .cc, .cpp, .cxx, .c++, .ii (all case-sensitive) |
The Renesas compiler models define the following macros in addition to the standard CodeSonar predefined macros.
ccrx Macros |
|||||||||||||||||||||||||||||||||||||||||||||||||
| Always Defined |
|
||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Conditionally Defined |
|
||||||||||||||||||||||||||||||||||||||||||||||||
ch38 Macros |
|||||||||||||||||||||||||||||||||||||||||||||||||
| Always Defined |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Conditionally Defined |
|
||||||||||||||||||||||||||||||||||||||||||||||||
shc and shcpp Macros |
|||||||||||||||||||||||||||||||||||||||||||||||||
| Always Defined |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Conditionally Defined |
|
||||||||||||||||||||||||||||||||||||||||||||||||
This section describes the C language extensions supported by the Renesas C/C++ compilers for the SuperH RISC engine family (shc/shcpp), and the treatment of those extensions in the compiler models.
| Extension |
Fixed point data types:
|
|---|---|
| Treatment | Fixed point types supported by CodeSonar internal representation; literal fixed point values stored as float. |
| Extension | Predefined memory qualifiers __X, __Y; users can add up to 5 additional named memory spaces. |
|---|---|
| Treatment | Memory spaces not explicitly modeled. Use the --add_named_address_space front end option to add user-defined memory spaces. |
| Extension |
Additional keywords
|
|---|---|
| Treatment | The compiler model scans and ignores these keywords. |
| Extension |
Additional keywords
|
|---|---|
| Treatment | The compiler model treats these keywords as function calls. |
| Extension | Nested comments are disallowed by default, but users can use nested comments if they specify command line option comment=nest or enable IDE option Allow comment nest. |
|---|---|
| Treatment | The compiler model will issue a warning if -comment=nest occurs on the command line or Allow comment nest is enabled. If nested comments actually occur they will cause parse errors. |
The following table describes the C language extensions supported by the Renesas C/C++ compiler for the H8S, H8/300 Series (ch38), and the treatment of those extensions in the compiler model.
| Extension |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Treatment | The compiler model scans and ignores these extension specifiers and keywords except for those marked with an asterisk (*), which the model treats in the same way as the compiler. |
| Extension |
Additional keywords
|
|---|---|
| Treatment | The compiler model treats these keywords as function calls. |
To report problems with this documentation, please visit https://support.codesecure.com/.