Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC2012-Rule-8.3

In this section:
Synopsis

(Required) All declarations of an object or function shall use the same names and type qualifiers.

Enabled by default

Yes

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Multiple declarations of an object or function were found that use different names and type qualifiers. This check is identical to CERT-DCL40-C.

This is a link analysis check.

Coding standards
CERT DCL40-C

Incompatible declarations of the same function or object

MISRA C:2012 Rule-8.3

(Required) All declarations of an object or function shall use the same names and type qualifiers

Code examples

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

/* file2.c:
const int x;
volatile int v;
*/
extern const unsigned int x;

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

/* file2.c
extern const int x;
 */
const int x;

int foo(const int param) {
  return (param + 1);
}