Misleading warning "returning a dangling pointer" for output parameters
mgehre opened this issue · 2 comments
mgehre commented
On
bool f(int **p) {
return true;
}
we diagnose warning: returning a dangling pointer [-Wlifetime]
on the return statement. The warnings is supposed to be about p
, which is considered an output parameter, but it can be quite confusing. The diagnostic should at least mention p
and probably avoid the word returning
.
Xazax-hun commented
This makes sense, thanks! I will create a better warning message for that.