Last Comment Bug 609710 - TestStartupCache.cpp has build warnings for deprecated conversion from string constant to 'char*'
: TestStartupCache.cpp has build warnings for deprecated conversion from string...
Status: RESOLVED FIXED
[build_warning]
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla12
Assigned To: Nathan Froyd [:froydnj]
:
Mentors:
Depends on:
Blocks: buildwarning 520309
  Show dependency treegraph
 
Reported: 2010-11-04 13:31 PDT by Daniel Holbert [:dholbert]
Modified: 2012-01-03 04:01 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix warnings (2.37 KB, patch)
2011-12-29 08:41 PST, Nathan Froyd [:froydnj]
mwu.code: review+
Details | Diff | Splinter Review
fix warnings, v2 (2.72 KB, patch)
2011-12-29 10:16 PST, Nathan Froyd [:froydnj]
mwu.code: review+
Ms2ger: feedback+
Details | Diff | Splinter Review
fix warnings, v3 (2.94 KB, patch)
2011-12-29 14:10 PST, Nathan Froyd [:froydnj]
nfroyd: review+
nfroyd: feedback+
Details | Diff | Splinter Review

Description Daniel Holbert [:dholbert] 2010-11-04 13:31:35 PDT
The fairly-recently-added file TestStartupCache.cpp spams 13 lines of GCC build warnings when compiled:

> startupcache/test/TestStartupCache.cpp: In function 'nsresult TestStartupWriteRead()':
> startupcache/test/TestStartupCache.cpp:116: warning: deprecated conversion from string constant to 'char*'
> startupcache/test/TestStartupCache.cpp:117: warning: deprecated conversion from string constant to 'char*'
> startupcache/test/TestStartupCache.cpp: In function 'nsresult TestWriteInvalidateRead()':
> startupcache/test/TestStartupCache.cpp:145: warning: deprecated conversion from string constant to 'char*'
> startupcache/test/TestStartupCache.cpp:146: warning: deprecated conversion from string constant to 'char*'
> startupcache/test/TestStartupCache.cpp: In function 'nsresult TestWriteObject()':
> startupcache/test/TestStartupCache.cpp:194: warning: deprecated conversion from string constant to 'char*'
> startupcache/test/TestStartupCache.cpp: In function 'nsresult TestEarlyShutdown()':
> startupcache/test/TestStartupCache.cpp:285: warning: deprecated conversion from string constant to 'char*'
> startupcache/test/TestStartupCache.cpp:286: warning: deprecated conversion from string constant to 'char*'
> startupcache/test/TestStartupCache.cpp: In function 'int main(int, char**)':
> startupcache/test/TestStartupCache.cpp:320: warning: unused variable 'rv2'

Filing this bug on fixing these.
Comment 1 Nathan Froyd [:froydnj] 2011-12-29 08:41:19 PST
Created attachment 584763 [details] [diff] [review]
fix warnings

Trivial patch.  The constantification of variables is a no brainer; the ugly bit is the necessity of using const_cast, but that is required by the generated IDL headers, so...
Comment 2 :Ms2ger (⌚ UTC+1/+2) 2011-12-29 09:33:52 PST
The nsIStartupCache interface is provided for testing purposes only, and StartupCache::PutBuffer takes a const char*. We should just fix the IDL.
Comment 3 Nathan Froyd [:froydnj] 2011-12-29 10:16:44 PST
Created attachment 584788 [details] [diff] [review]
fix warnings, v2

Ms2ger, is this what you had in mind?

I can't carryover mwu's r+, so re-r?'ing him.
Comment 4 :Ms2ger (⌚ UTC+1/+2) 2011-12-29 10:23:44 PST
Comment on attachment 584788 [details] [diff] [review]
fix warnings, v2

Yes, looks good. Thanks.
Comment 5 Michael Wu [:mwu] 2011-12-29 11:39:00 PST
Comment on attachment 584788 [details] [diff] [review]
fix warnings, v2

Even better. Just rev the uuid when you check this in.
Comment 6 Nathan Froyd [:froydnj] 2011-12-29 14:10:50 PST
Created attachment 584845 [details] [diff] [review]
fix warnings, v3

Rev'ing UUID, carrying over +'s.
Comment 7 :Ms2ger (⌚ UTC+1/+2) 2012-01-02 10:12:19 PST
I'll land it tomorrow.
Comment 8 :Ms2ger (⌚ UTC+1/+2) 2012-01-03 04:01:21 PST
https://hg.mozilla.org/mozilla-central/rev/092e88ea2eb7

Note You need to log in before you can comment on or make changes to this bug.