Skip to main content

IAR Embedded Workbench for RH850 3.20.x

MISRAC++2008-9-6-2

In this section:
Synopsis

(Required) Bit-fields shall be either bool type or an explicitly unsigned or signed integral type.

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

Bitfields of plain int type were found.

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:

struct bad {
  int x:3;
};

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

struct good {
	unsigned int x:3;
};