Skip to main content

IAR Embedded Workbench for RX 5.20

MISRAC2012-Rule-11.5

In this section:
Synopsis

(Advisory) A conversion should not be performed from pointer to void into pointer to object.

Enabled by default

No

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

A conversion from a pointer to void into a pointer to object was found. This check is identical to CERT-EXP36-C_b.

Coding standards
CERT EXP36-C

Do not convert pointers into more strictly aligned pointer types

MISRA C:2012 Rule-11.5

(Advisory) A conversion should not be performed from pointer to void into pointer to object

Code examples

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

void example(void) {
  int * x;
  void * y;
  x = y;
}

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

void example(void) {}