Closed
Bug 457003
Opened 16 years ago
Closed 6 years ago
analysis wanted: class defs that should be in an anonymous namespace and/or moved between .h and .cpp
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Developer Infrastructure
Source Code Analysis
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: zwol, Unassigned)
References
Details
If an object type definition (struct/class) is in a .cpp file, all its members are also defined in that file, and all references to the type are in that file as well, then the type definition should be wrapped in an anonymous namespace. I don't believe it is also necessary to wrap member function definitions, but it might be clearer. If an object type definition is in a .cpp file but the other conditions *don't* apply, then that definition belongs in an .h file instead, and the user should be notified, especially if there are two or more .cpp files that define the same type (which there would have to be, really). Conversely, if an object type definition is in an .h file but all references to it are in the same .cpp file as all its member definitions, then the type should perhaps be moved to that .cpp file and be wrapped in an anonymous namespace. These changes should have no visible effect at the program level but should speed up linking and loading, since the symbols for member functions whose class is in an anonymous namespace can be made local to the object file. [I don't know if any of the compilers we care about have bugs with the anonymous namespace. I hope not.]
Updated•6 years ago
|
Product: Core → Firefox Build System
Comment 1•6 years ago
|
||
No real interest in this, closing.
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
•