Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Lower case Lowercase letter 'l' (ell) can easily be confused with the digit '1' (one). This can be particularly confusing when indicating that an integer literal constant is a long value. This rule recommendation is similar to recommendation DCL02-C. Use visually distinct identifiers.

Likewise, you should use 'uppercase LL' rather than 'lowercase ll' when indicating that an integer literal constant is a long long value.

...

Code Block
bgColor#FFCCCC
langc

	printf("Sum is %ld\n", 1111 + 111l);

...

The compliant solution improvises by using an upper case 'uppercase L ' instead of lower case 'lowercase l ' to disambiguate the visual appearance.

Code Block
bgColor#ccccff
langc

	printf("Sum is %ld\n", 1111 + 111L);

Risk Assessment

Confusing a lower case lowercase letter 'l' (ell) with a digit '1' (one) when indicating that an integer denotation is a long value could lead to an incorrect value being written into code.

...

section

Fully

Implemented

implemented

Tool

Version

Checker

Description

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V
section

ltrlsynt

Section

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

...

Lockheed Martin 2005 AV Rule 14, " Literal suffixes shall use uppercase rather than lowercase letters."

...