Skip to main content

IAR Embedded Workbench for RISC-V 3.40

MISRAC++2008-2-13-2

In this section:
Synopsis

(Required) Octal constants (other than zero) and octal escape sequences (other than 0) shall not be used.

Enabled by default

Yes

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Octal integer constants are used. This check is identical to MISRAC2004-7.1, MISRAC2012-Rule-7.1, MISRAC++2023-5.13.3.

Coding standards
MISRA C:2004 7.1

(Required) Octal constants shall not be used. Zero is okay

MISRA C:2012 Rule-7.1

(Required) Octal constants shall not be used

MISRA C++ 2023 5.13.3

(Required) Octal constants shall not be used

Code examples

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

void
func(void)
{
    int x = 077;
}

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

void
func(void)
{
    int x = 63;
}