Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This exception does not permit narrowing conversions with no without range-checking among integral types. The following code example demonstrates how to perform explicit narrowing from a long to an int where range-checking is not required.

...

The CERT C Secure Coding Standard

INT31-C. Ensure that integer conversions do not result in lost or misinterpreted data

 

FLP34-C. Ensure that floating point conversions are within range of the new type

The CERT C++ Secure Coding Standard

INT31-CPP. Ensure that integer conversions do not result in lost or misinterpreted data

 

FLP34-CPP. Ensure that floating point conversions are within range of the new type

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e267145c53a986d4-c888cf53-4f6348c5-a2e7af94-b2c326eb2b402a1c8c2d5f0e"><ac:plain-text-body><![CDATA[

[ISO/IEC TR 24772:2010

http://www.aitcnet.org/isai/]

"Numeric Conversion Errors [FLC]"

]]></ac:plain-text-body></ac:structured-macro>

MITRE CWE

CWE ID 681, "Incorrect Conversion between Numeric Types"

 

CWE ID 197, "Numeric Truncation Error"

...