Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC++2023-6.9.2

In this section:
Synopsis

(Advisory) The names of the standard signed integer types and standard unsigned integer types should not be used

Enabled by default

No

Severity/Certainty

Low/High

lowhigh.png
Full description

There are uses of the basic types char, int, short, long, double, and float without a typedef. This check is identical to MISRAC++2008-3-9-2, MISRAC2004-6.3, MISRAC2012-Dir-4.6_a.

Coding standards
MISRA C:2004 6.3

(Advisory) typedefs that indicate size and signedness should be used in place of the basic types.

MISRA C:2012 Dir-4.6

(Advisory) typedefs that indicate size and signedness should be used in place of the basic numerical types

MISRA C++ 2008 3-9-2

(Advisory) typedefs that indicate size and signedness should be used in place of the basic numerical types.

Code examples

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

typedef signed char SCHAR;
typedef int INT;
typedef float FLOAT;

INT func(FLOAT f, INT *pi)
{
  INT x;
  INT (*fp)(const unsigned char *);
}

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

typedef signed char SCHAR;
typedef int INT;
typedef float FLOAT;

INT func(FLOAT f, INT *pi)
{
  INT x;
  INT (*fp)(const SCHAR *);
}