------- Comment #2 from sigra at home dot se  2006-09-24 23:29 -------
Sorry, accidentally hit commit too early. Try again:

There should be a warning about unchecked use of pointers in C++. For example:
void f(T * const x) {
   x->something... //  x might be 0, warn.
}

void f(T * const x) {
   if (x) x->something... //  this is OK, no need to warn
}

This warning would help to find places where the programmer has made a very
common kind of error; he has made the function take a pointer parameter when he
should have used a reference instead.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29208

Reply via email to