[metadata]
id = "DCL18-C"
type = "recommendation"
category = "DCL"
number = 18
title = "Do not begin integer constants with 0 when specifying a decimal value"
description = """
The C Standard defines octal constants as a 0 followed by octal digits (0 1 2 3
4 5 6 7). Programming errors can occur when decimal values are mistakenly
specified as octal constants. In this noncompliant code example, a decimal
constant is mistakenly prefaced with zeros so that all the constants are a fixed
length: i_array[0] = 2719; i_array[1] = 4435; i_array[2] = 0042;
"""
severity = "Low"
likelihood = "Unlikely"
priority = "P1"
level = "L3"
cert_version = "2016 Edition (Wiki)"
last_modified = "May 19, 2025"
[rules.cert_c.DCL18-C]
enabled = true
[references]
wiki = "https://wiki.sei.cmu.edu/confluence/display/c/DCL18-C.+Do+not+begin+integer+constants+with+0+when+specifying+a+decimal+value"