|
From: Jeremy F. <je...@go...> - 2004-01-02 01:01:09
|
On Thu, 2004-01-01 at 14:46, John Regehr wrote: > A nasty programming bug occurs when you pick an insufficiently large > integer type for a variable and it overflow or underflows. Seems like it > wouldn't be too hard to develop to valgrind skin that checks for this > error. Anybody see obvious problems with this idea? I think there would be far too many false positives. Many programmers and all compilers know enough about twos compliment arithmetic to take advantage of overflow, so there would be many instances of correct usage of overflow and truncation. You need to come up with a more precise definition of what the error case is, and how to distinguish it from correct usage. If you report every instance of overflow or underflow, the tool would be useless for all the messages it generates. J |