Closed
Bug 517370
Opened 15 years ago
Closed 6 years ago
alwayszero function attribute for gcc
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Tracking
(Not tracked)
RESOLVED
INACTIVE
People
(Reporter: taras.mozilla, Assigned: ehren.m)
References
Details
(Keywords: student-project)
Attachments
(4 files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
text/plain
|
Details | |
(deleted),
text/plain
|
Details |
In mozilla we have a lot of functions that always return NS_OK(0). This means that callers of such functions usually have unneeded error checking.
nsresult rv = call();
if (NS_FAILED(rv)....) <-- gcc should be able to optimize this away if it knows that value of call() is always zero
For reference see gcc function attributes: pure, const. and Gcc variable attribute nonnull(I don't see that one in the docs anymore, is it gone?).
Updated•15 years ago
|
Keywords: student-project
Reporter | ||
Comment 1•15 years ago
|
||
alternatively/additionally we should do static analysis to ensure that always zerofunctions
a) only ever return 0
b) never have their return value checked
Updated•15 years ago
|
Assignee: nobody → ehren.m
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•15 years ago
|
||
This has a problem with being able to print off the class location of a method with a misapplied attribute. Being a ripoff of outparams.js, there may still be some unnecessary code as well.
Assignee | ||
Comment 3•15 years ago
|
||
there are some indenting issues here, particularly when a declaration is broken over several lines.
Assignee | ||
Comment 4•15 years ago
|
||
Assignee | ||
Comment 5•15 years ago
|
||
compile with make CC=/path/to/plugin-enabled/gcc (requires plugin framework from GCC 4.5)
Assignee | ||
Updated•15 years ago
|
Attachment #416042 -
Attachment mime type: text/x-csrc → text/plain
Assignee | ||
Updated•15 years ago
|
Attachment #416043 -
Attachment mime type: application/octet-stream → text/plain
Assignee | ||
Comment 6•15 years ago
|
||
Not sure if all of this is ready for review yet. For one thing when FIND_NEW_FUNCTIONS = true, a whole lot of output will be printed during static analysis builds. There's also a lot more patching to be done (likely with Pork).
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•6 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → INACTIVE
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
•