AutosarC++17_03-A0.4.2

Type long double shall not be used

Required inputs: IR

Rationale

The width of long double type, and therefore width of the significand, is implementation-defined.

The width of long double type can be either:

  • 64 bits, as the C++14 Language Standard allows long double to provide at leastas much precision as type double does, or
  • 80 bits, as the IEEE 754 standard allows extended precision formats (see:Extended-Precision-Format), or
  • 128 bits, as the IEEE 754 standard defines quadruple precision format
Example
//% $Id: A0-4-2.cpp 270021   2017-03-09 15:30:37Z piotr.tanski $
void fn() noexcept {
float f1{0.1F};       // Compliant
double f2{0.1};       // Compliant
long double f3{0.1L}; // Non-compliant
}
See Also
  • none

Possible Messages

Key

Text

Severity

Disabled

type_used

The type shall not be used.

None

False

Options

forbidden_types

forbidden_types : set[bauhaus.ir.LIR_Class_Name] = {'C_Long_Double_Type'}

The ir.Logical Types not to be used e.g. C_Long_Double_Type.