Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

MISRA.TOKEN.L.SUFFIX.FLOAT

Usage of lowercase character "l" suffix in floating constant.

MISRA C 2012 Rule 7.3: The lowercase character “l” shall not be used in a literal suffix

Category: Required

Analysis: Decidable, Single Translation Unit

Applies to: C90, C99

Rationale

Using the uppercase suffix “L” removes the potential ambiguity between “1” (digit 1) and “l” (letter “el”) when declaring literals.

Example

Note: the examples containing the long long suffix are applicable only to C99.

const int64_t     a = 0L; 
const int64_t     b = 0l;      /* Non-compliant */ 
const uint64_t    c = 0Lu;
const uint64_t    d = 0lU;     /* Non-compliant */ 
const uint64_t    e = 0ULL;    
const uint64_t    f = 0Ull;    /* Non-compliant */ 
const int128_t    g = 0LL; 
const int128_t    h = 0ll;     /* Non-compliant */ 
const float128_t  m = 1.2L; 
const float128_t  n = 2.4l;    /* Non-compliant */