When to address integer overflow in C
Posted
by Yktula
on Stack Overflow
See other posts from Stack Overflow
or by Yktula
Published on 2010-04-25T18:44:43Z
Indexed on
2010/04/25
19:13 UTC
Read the original article
Hit count: 468
best-practices
|c
Related question: http://stackoverflow.com/questions/199333/best-way-to-detect-integer-overflow-in-c-c
In C code, should integer overflow be addressed whenever integers are added? It seems like pointers and array indexes should be checked at all. When should integer overflow be checked for?
When numbers are added in C without type explicitly mentioned, or printed with printf, when will overflow occur?
Is there a way to automatically detect when an integer arithmetic overflow?
© Stack Overflow or respective owner