Skip to main content

IAR Embedded Workbench for RL78 5.20

MISRAC++2008-7-4-3

In this section:
Synopsis

(Required) Assembler language shall be encapsulated and isolated.

Enabled by default

Yes

Severity/Certainty

Low/Medium

lowmedium.png
Full description

There are inline assembler statements that are not encapsulated in functions. This check is identical to MISRAC2004-2.1, MISRAC2012-Dir-4.3.

Coding standards
MISRA C:2004 2.1

(Required) Assembler language shall be encapsulated and isolated.

MISRA C:2012 Dir-4.3

(Required) Assembly language shall be encapsulated and isolated

Code examples

The following code example fails the check and will give a warning:

int example(void)
{
  int r;
  asm("");
  return r + 1;
}

The following code example passes the check and will not give a warning about this issue:

int example(int x)
{
  asm("");
  return x;
}