(Platform/OS should really read "any on which we use a compiler supporting a warn_unused_result-type attribute".) In Electrolysis, we call functions that end up sending IPC messages to other processes. *Any* invocation of these functions may fail, since the other process may die completely unpredictably. I'm sure there are other functions like this in mozilla-central (networking comes to mind). So we want to ensure that the return value from such functions is always checked. gcc's __attribute__((warn_unused_result)) is a start, and -Werror=warn_unused_result (or whatever it is) is even better. A static analysis that makes warn_unused_result a transitive property is best of all.
9 years ago
Created attachment 402876 [details] [diff] [review] adds NS_WARN_UNUSED macro Not tryserver'ing because this is just code taken from bug 441324.
Infallible malloc is about ready to land, and that patch incidentally adds this attribute. (RESOLVED SUBSUMED would be more appropriate.)
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 441324
9 years ago
No longer blocks: 518881
You need to log in before you can comment on or make changes to this bug.