Versions Compared

Key

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

...

This noncompliant example highlights the result of adding an integer and a long value even though it appears that two integers 1111 are being added.:

Code Block
bgColor#FFCCCC
langc
	printf("Sum is %ld\n", 1111 + 111l);

...

The compliant solution improvises by using an uppercase L instead of lowercase l to disambiguate the visual appearance.:

Code Block
bgColor#ccccff
langc
	printf("Sum is %ld\n", 1111 + 111L);

...

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

Related Guidelines

Bibliography

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

 

...