AUTOSAR C++14 Rule A0-4-2
Type long double shall not be used
Description
Rule Definition
Type long double shall not be used.
Rationale
The size of long double
is implementation-dependent and reduces the
portability of your code across compilers. Compilers can implement long
double
as a synonym for double
or an 80-bit extended
precision type or 128-bit quadruple precision type that are more precise than
double
.
Instead, for multiple precision arithmetic that requires types more precise than
double
, use libraries that support multiple precision arithmetic with
well-defined data types.
Polyspace Implementation
The rule checker flags all uses of the long double
keyword.
If you do not want to fix the issue, add a comment justifying the result. See:
Address Results in Polyspace User Interface Through Bug Fixes or Justifications if you review results in the Polyspace user interface.
Address Results in Polyspace Access Through Bug Fixes or Justifications (Polyspace Access) if you review results in a web browser.
Annotate Code and Hide Known or Acceptable Results if you review results in an IDE.
Troubleshooting
If you expect a rule violation but Polyspace® does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Language independent issues |
Category: Required, Automated |
Version History
Introduced in R2019a