JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++


LANG.TYPE.CSUF : Confusing Literal Suffix

Summary

Lower case 'l' is used as a literal suffix.

(Using 'L' instead removes the potential for misreading as numeric character '1'.)

Properties

Class Name Confusing Literal Suffix
Significance style
Mnemonic LANG.TYPE.CSUF
Categories
MisraC2025 MisraC2025:7.3 The lowercase character "l" shall not be used in a literal suffix
MisraC2023 MisraC2023:7.3 The lowercase character "l" shall not be used in a literal suffix
Misra2012 Misra2012:7.3 The lowercase character "l" shall not be used in a literal suffix
AUTOSARC++14 AUTOSARC++14:M2-13-4 Literal suffixes shall be upper case.
MisraC++2008 MisraC++2008:2-13-4 Literal suffixes shall be upper case.
MisraC++2023 MisraC++2023:5.13.5 The lowercase form of "L" shall not be used as the first character in a literal suffix
  MisraC++2023:5.13.6 An integer literal of type long long shall not use a single L or l in any suffix
CWE CWE:710 Improper Adherence to Coding Standards
CERT-C CERT-C:DCL16-C Use "L," not "l," to indicate a long value
JSF++ JSF++:14 Literal suffixes shall use uppercase rather than lowercase letters.
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default, and require the unnormalized C ASTs for the project. To enable them, add the following WARNING_FILTER rule and RETAIN_UNNORMALIZED_C_AST specification to the project configuration file.
RETAIN_UNNORMALIZED_C_AST = Yes
WARNING_FILTER += allow class="Confusing Literal Suffix"
Note that retaining the unnormalized ASTs will increase the disk space used to store the project representation, and may make the analysis take longer.

Example

unsigned long a = 0Lu;  
unsigned long b = 0lU; /* 'Confusing Literal Suffix warning issued here */
long long c = 0LL;
long long d = 0ll;     /* 'Confusing Literal Suffix warning issued here */
long double e = 1.2L;
long double f = 2.4l;  /* 'Confusing Literal Suffix warning issued here */

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.

 

To report problems with this documentation, please visit https://support.codesecure.com/.