Closed
Bug 518880
Opened 15 years ago
Closed 15 years ago
Add support for warning/error'ing when important return values are unused
Categories
(Developer Infrastructure :: Source Code Analysis, enhancement)
Developer Infrastructure
Source Code Analysis
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 441324
People
(Reporter: cjones, Assigned: cjones)
Details
Attachments
(1 file)
1.86 KB,
patch
|
Details | Diff | Splinter Review |
(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.
Assignee | ||
Comment 1•15 years ago
|
||
Not tryserver'ing because this is just code taken from bug 441324.
Attachment #402876 -
Flags: review?(benjamin)
Assignee | ||
Comment 2•15 years ago
|
||
Infallible malloc is about ready to land, and that patch incidentally adds this attribute. (RESOLVED SUBSUMED would be more appropriate.)
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → DUPLICATE
Updated•15 years ago
|
Attachment #402876 -
Flags: review?(benjamin)
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•