Closed
Bug 497832
Opened 16 years ago
Closed 16 years ago
compiler spam: bug 374336 added 139 instances of warning "nsIdentityChecking.cpp:418: warning: deprecated conversion from string constant to ‘char*’"
Categories
(Core :: Security: PSM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: KaiE)
References
Details
(Whiteboard: [build_warning])
Attachments
(1 file)
2.08 KB,
patch
|
neil
:
review+
KaiE
:
review+
|
Details | Diff | Splinter Review |
As mentioned in bug 374336 comment 42, that bug's patch removed some 'const' keywords and subsequently triggered 139 new g++ compiler warnings, all of the form:
> nsIdentityChecking.cpp:418: warning: deprecated conversion from string constant
to ‘char*’
I'm filing this bug on fixing those warnings, for reduced compiler-spam.
Reporter | ||
Comment 1•16 years ago
|
||
Note that in bug 374336, the 'const' keyword was removed in response to a suggestion in bug 374336 comment 30, because the newly-introduced free() calls expect a 'void*' argument (rather than a 'const void*').
I'm attaching a patch that restores the const keyword, and works around the 'free()' issue by using const_cast to remove the 'const' solely for the 'free' calls.
IMHO this is a cleaner solution than the existing situation. The idea here is this:
- At the superclass level (for "struct nsMyTrustedEVInfo"), our char-pointers may be pointing to mutable or immutable memory, so it's safest & most correct to make them "const".
- In the subclass ("class nsMyTrustedEVInfoClass : public nsMyTrustedEVInfo"), we know that all of its instances will have char-pointers directed at mutable (heap-allocated) memory, so we can allow ourselves to explicitly cast away the constness when we need to. (in just one place -- the destructor)
Attachment #382933 -
Flags: review?(neil)
Comment 2•16 years ago
|
||
I love reducing compiler spam - is there a reason you didn't tag kaie for the review, since he wrote the orginal code, iinm?
Updated•16 years ago
|
Attachment #382933 -
Flags: review?(neil) → review+
Comment 3•16 years ago
|
||
Comment on attachment 382933 [details] [diff] [review]
fix: restore const-ness, and cast it away for 'free' call
I am not a PSM peer, but I agree that this seems the simplest solution.
Reporter | ||
Comment 4•16 years ago
|
||
Comment on attachment 382933 [details] [diff] [review]
fix: restore const-ness, and cast it away for 'free' call
> is there a reason you didn't tag kaie for the
> review, since he wrote the orginal code, iinm?
No, no good reasons. :) (It was late, and I tagged neil because wrote bug 374336 comment 30 and posted the final copy of the patch on that bug.)
Thanks for the suggestion -- tagging kaie for additional review.
Attachment #382933 -
Flags: review?(kaie)
Assignee | ||
Updated•16 years ago
|
Attachment #382933 -
Flags: review?(kaie) → review+
Reporter | ||
Comment 5•16 years ago
|
||
Patch pushed to mozilla-central:
http://hg.mozilla.org/mozilla-central/rev/f7e29a820cc0
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Reporter | ||
Updated•15 years ago
|
Whiteboard: [build_warning]
You need to log in
before you can comment on or make changes to this bug.
Description
•