Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC2012-Rule-8.10

In this section:
Synopsis

(Required) An inline function shall be declared with the static storage class.

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

Inline functions were found that are not declared as static.

Coding standards
MISRA C:2012 Rule-8.10

(Required) An inline function shall be declared with the static storage class

Code examples

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

inline int example(int a) {
  return a + 1;
}

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

inline static int example(int a) {
  return a + 1;
}