|
|
|
|
|
by MaxBarraclough
2016 days ago
|
|
I agree with you here, but even these two categories of runtime errors are much more painful in C/C++ than in most other languages. As I mentioned elsewhere in the thread, you can ask gcc to trap if your code is about to dereference NULL, but the compiler can't easily detect all instances of out-of-bounds array access, due to the way arrays and pointers work in C. I believe Valgrind can help detect out-of-bounds errors at runtime, but in most languages you don't need a sledgehammer like Valgrind to find these common errors. |
|