IAR Embedded Workbench Compiler (-compiler
iar-ew
)
Specify IAR Embedded Workbench compiler
Description
Specify iar-ew
for Compiler
(-compiler)
if you compile your code using a IAR Embedded Workbench
compiler. By specifying your compiler, you can avoid compilation errors from syntax that
is not part of the Standard but comes from language extensions.
Then, specify your target processor type. If you select
iar-ew
for Compiler, in the user
interface of the Polyspace® desktop products, you see only the processors allowed for a IAR Embedded
Workbench compiler. Your choice of target processor determines the size of fundamental
data types, the endianness of the target machine and certain keyword definitions.
If you specify the iar-ew
compiler, you must specify the
path to your compiler header files. See Provide Standard Library Headers for Polyspace Analysis.
Settings
The targets use the following default sizes in bits for the fundamental types. You do not see these sizes in the user interface of the Polyspace desktop products.
Target | char | short | int | long | long long | float | double | long double | ptr | Default sign of char | Endianness | Alignment | Definition of size_t | Definition of wchar_t |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arm | 8 | 16 | 32 | 32 | 64 | 32 | 64 | 64 | 32 | Unsigned | Little | 64 | unsigned int | short |
avr | 8 | 16 | 16 | 32 | 64 | 32 | 32 | 32 | 16 | Unsigned | Little | 8 | unsigned int | unsigned short |
msp430 | 8 | 16 | 16 | 32 | 64 | 32 | 32 | 32 | 16 | Unsigned | Little | 16 | unsigned int | unsigned short |
rh850 | 8 | 16 | 32 | 32 | 64 | 32 | 64 | 64 | 32 | Unsigned | Little | 32 | unsigned int | short |
riscv | 8 | 16 | 32 | 32 | 64 | 32 | 64 | 64 | 32 | unsigned | Little | 64 | unsigned int | unsigned int |
rl78 | 8 | 16 | 16 | 32 | 64 | 32 | 32 | 32 | 16 | Unsigned | Little | 16 | unsigned int | unsigned short |
Your compiler specification also determines the values of many compiler-specific
macros. In case you want to know how Polyspace defines a specific macro, use the option -dump-preprocessing-info
.
To override the macro definition, use the option
Preprocessor definitions (-D)
.To undefine a macro, use the option
Disabled preprocessor definitions (-U)
.
Tips
Polyspace does not support the use of
$Super$$
and$Sub$$
to patch symbol definitions. For instance, the following code compiles correctly, but Polyspace considers thatmain()
calls theextern func ($Super$$func)
instead of the functionfunc
defined in this code($Sub$$func)
:To make sure that Polyspace calls the correct function when analyzing your code, replace all instance of/* void func() declared in another file */ extern void $Super$$func(int i); int setup = 0; void setup_func(int i) { setup = i; } /* this function should be called instead of the original extern func() */ void $Sub$$func(int i) { setup_foo(i); /* does some extra setup work */ /* ... */ } int main() { assert(setup = 0); func(1); // Should call $Sub$$func instead of $Super$$func assert(setup = 1); return 0; }
$Sub$$
with an empty string in all your files after preprocessing. SeeCommand/script to apply to preprocessed files (-post-preprocessing-command)
.Polyspace does not support some constructs specific to the IAR compiler.
For the list of unsupported constructs, see
codeprover_limitations.pdf
in
. Here,polyspaceroot
\polyspace\verifier\code_prover_desktop
is the MATLAB® installation folder, for instance,polyspaceroot
C:\Program Files\Polyspace\R2019a
.If you use Polyspace as You Code extensions in IDEs, enter this option in an analysis options file. See options file.
Command-Line Information
Parameter:
-compiler iar-ew -target |
Value:
arm | avr | msp430 | rh850 | riscv | rl78 |
Default:
arm |
Example (Bug Finder):
polyspace-bug-finder -compiler iar-ew -target
rl78 |
Example (Code Prover):
polyspace-code-prover -compiler iar-ew -target
rl78 |
Example (Bug Finder Server):
polyspace-bug-finder-server -compiler iar-ew -target
rl78 |
Example (Code Prover
Server):
polyspace-code-prover-server
-compiler iar-ew -target rl78 |
Version History
Introduced in R2018a