Versions Compared

Key

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

...

Automated detection of narrowing conversions on integral types is straightforward. Determining whether such conversions correctly reflect the intent of the programmer is infeasible in the general case. Heuristic warnings could be useful.

Related Guidelines

C Secure Coding Standard

...

...

...

...

...

CWE-681 "Incorrect Conversion between Numeric Types"

 

...

...

-197 "Numeric Truncation Error"

Bibliography

...