Closed
Bug 449623
Opened 16 years ago
Closed 6 years ago
Const-correct Mozilla code
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: kschwarz, Assigned: jgalenson)
References
Details
The mozilla-central code base is, for the most part, not const-correct. Developers who want to write const-correct code commonly have to rewrite or const-overload functions in other parts of the source. We propose using dehydra to automatically const-correct as much of the code base as possible.
Comment 1•16 years ago
|
||
What kinds of things do you think should be const-correct? Anything that goes through xpidl and javascript cannot be const (because JS doesn't not have that concept). Strings and the basic data structures are for the most part const-correct... can you give examples?
Reporter | ||
Comment 2•16 years ago
|
||
My main experience has been with nsIFrame and nsIView, neither of which is const-correct. I don't think that either of these classes go through XPIDL, since some of the functions are already const-corrected. When working on the CSS transforms patch, I ended up const-correcting a good number of member and helper functions, and though I don't have as much experience working with other parts of the code base, I'm pretty sure that other modules could be similarly improved. Even if we weren't able to make the entire code base const-correct, if we were simply able to make some of the modules internally const-correct, I think it would make the code a lot less bug-prone.
Comment 3•16 years ago
|
||
Well, doing this mozilla-wide sounds tricky if only because breaking public interfaces sucks. But i'm sure some of this is doable. best place to start would be to find a piece of code that isn't const correct and start devising steps needed to detect & convert it.
Reporter | ||
Updated•16 years ago
|
Blocks: static_analyses
Updated•7 years ago
|
Product: Core → Firefox Build System
![]() |
||
Comment 4•6 years ago
|
||
While this is a good thing, we're not going to write an analysis for it, and I think people are better about sticking const in places where it logically belongs nowadays.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
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
•