You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
After looking at the (filtered) results on some real world code I think sometimes the current error messages are rather hard to grok. One of the main reason is that the reader have no idea how the calls are evaluated.
Consider the following code:
std::string_view v = p->getAttribute("AttributeName");
use(v); // warning
We might get a warning about v dangling, but we have no idea why would it dangle. In this case having a note like Assuming getAttribute returns an object with the same lifetime as its argument would help a lot. Because the code above is false positive, the lifetime of the returned pointer is tied to p and not to the argument. Having a note like this makes the problem quite apparent, and gives a hint to the user how to annotate getAttribute to get rid of the warning.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
After looking at the (filtered) results on some real world code I think sometimes the current error messages are rather hard to grok. One of the main reason is that the reader have no idea how the calls are evaluated.
Consider the following code:
We might get a warning about
v
dangling, but we have no idea why would it dangle. In this case having a note likeAssuming getAttribute returns an object with the same lifetime as its argument
would help a lot. Because the code above is false positive, the lifetime of the returned pointer is tied top
and not to the argument. Having a note like this makes the problem quite apparent, and gives a hint to the user how to annotategetAttribute
to get rid of the warning.The text was updated successfully, but these errors were encountered: