Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC++2008-0-1-8

In this section:
Synopsis

(Required) All functions with void return type shall have external side effect(s).

Enabled by default

No

Severity/Certainty

Low/Low

lowlow.png
Full description

There are functions with no effect. A function with no return type and no side effects effectively does nothing. This check is identical to RED-func-no-effect.

Coding standards

This check does not correspond to any coding standard rules.

Code examples

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

void pointless (int i, char c)
{
  int local;
  local = 0;
  local = i;
}

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

void func(int *i)
{
  int p;
  p = *i;
  int *ptr;
  ptr = i;
  *i = p;
  (*i)++;
}