Closed
Bug 522776
Opened 15 years ago
Closed 4 years ago
Static analysis: Point out member shadowing
Categories
(Developer Infrastructure :: Source Code Analysis, enhancement)
Tracking
(Not tracked)
RESOLVED
WORKSFORME
People
(Reporter: taras.mozilla, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(2 files, 2 obsolete files)
11.81 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
12.39 KB,
patch
|
taras.mozilla
:
review+
mayhemer
:
review-
|
Details | Diff | Splinter Review |
Solaris compiler warns if a stack variable shadows a class member. I got burned by this. Filing this before i forget about it.
Can we get this running on the static analysis box?
Comment 2•15 years ago
|
||
If it runs as part of a standard --with-static-checking build we can!
Reporter | ||
Comment 3•15 years ago
|
||
make this an error is a lot of work. It trips up a lot of code. Could should probably be fixed as it doesn't follow naming conventions
Attachment #406754 -
Attachment is obsolete: true
Reporter | ||
Comment 4•15 years ago
|
||
With this patch the build can proceed. I'll probably need someone else for additional reviews on that 2 cases of member shadowing found in gtk and ssl code.
Attachment #408935 -
Attachment is obsolete: true
Attachment #410019 -
Flags: review?(benjamin)
Comment 5•15 years ago
|
||
Comment on attachment 410019 [details] [diff] [review] finished patch I can't tell from this: does this error on function parameters which are named the same as members? There should probably be a test for that case, one way or the other.
Attachment #410019 -
Flags: review?(benjamin) → review+
Reporter | ||
Comment 6•15 years ago
|
||
(In reply to comment #5) > (From update of attachment 410019 [details] [diff] [review]) > I can't tell from this: does this error on function parameters which are named > the same as members? There should probably be a test for that case, one way or > the other. no it doesn't. I couldn't decide if saying anything in that case would be useful or counterproductive.
Comment 7•15 years ago
|
||
I tend to think it would be useful but I don't care much: I just want a test so the behavior is clear and doesn't change accidentally.
Reporter | ||
Comment 8•15 years ago
|
||
carrying over Benjamin's review
Attachment #410043 -
Flags: review+
Reporter | ||
Comment 9•15 years ago
|
||
Comment on attachment 410043 [details] [diff] [review] added params testcase Honza, please review the change in security/.
Attachment #410043 -
Flags: review?(honzab.moz)
Comment 10•15 years ago
|
||
Comment on attachment 410043 [details] [diff] [review] added params testcase Taras, please rename the local variable to something else (something like nssComponentLocal, up to you). This code is old and I'm afraid it could introduce problems during shutdown/profile change, let's leave the current behavior. This local variable shadowing the (wrongly named!) member was introduced here: https://bugzilla.mozilla.org/attachment.cgi?id=106168&action=diff#mozilla/security/manager/ssl/src/nsUsageArrayHelper.cpp_sec1 I'll file a new bug to clean this up.
Attachment #410043 -
Flags: review?(honzab.moz) → review-
Reporter | ||
Comment 11•15 years ago
|
||
(In reply to comment #10) > I'll file a new bug to clean this up. Thanks, can you make it block this bug?
Updated•6 years ago
|
Product: Core → Firefox Build System
Comment 12•4 years ago
|
||
No longer the case.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
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
•