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 |
A numeric literal contains one or more digit separators ('), but the separator usage does not conform to the following policy.
| decimal, octal | separator every 3 digits |
| hexadecimal | separator every 2 digits |
| binary | separator every 4 digits |
A numeric literal with no digit separators will not trigger a warning of this class.
Digit separators were introduced in C++14 and C23. If you are using an earlier version, digit separators may cause a compiler error.
| Class Name | Misplaced Digit Separator | ||||||
|---|---|---|---|---|---|---|---|
| Significance | style | ||||||
| Mnemonic | LANG.TYPE.MDS | ||||||
| Categories |
|
||||||
| 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="Misplaced Digit Separator" |
// Decimals and octals: every three digits (or none) int jenny = 867'5309; // 'Misplaced Digit Separator' warning issued here int taxi = 1'729; // ok int alldigits = 1234567'890; // 'Misplaced Digit Separator' warning issued here float pi_approx = 3.141'15; // ok double e_approx = 2.7182818; // ok int all = 0777; // ok // Hexadecimals: every two digits (or none) int mask = 0xff'ff; // ok int mask_nosep = 0xffff; // ok int mask_badsep = 0xf'fff; // 'Misplaced Digit Separator' warning issued here // Binary numbers: every four digits (or none) int sig = 0b1101'1111; // ok int sig_nosep = 0b11011111; // ok int sig_badsep = 0b11'011'111; // 'Misplaced Digit Separator' warning issued here
The following configuration file parameters affect checks for this warning class.
To report problems with this documentation, please visit https://support.codesecure.com/.