Closed Bug 609710 Opened 9 years ago Closed 8 years ago

TestStartupCache.cpp has build warnings for deprecated conversion from string constant to 'char*'

Categories

(Core :: XPCOM, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla12

People

(Reporter: dholbert, Assigned: froydnj)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

Attachments

(1 file, 2 obsolete files)

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.
Blocks: 520309
Attached patch fix warnings (obsolete) — Splinter Review
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...
Assignee: nobody → nfroyd
Status: NEW → ASSIGNED
Attachment #584763 - Flags: review?(mwu)
Summary: TestStartupCache.cpp has build warnings for deprecated conversion from string constant to 'char*' and unused variable → TestStartupCache.cpp has build warnings for deprecated conversion from string constant to 'char*'
Attachment #584763 - Flags: review?(mwu) → review+
Keywords: checkin-needed
The nsIStartupCache interface is provided for testing purposes only, and StartupCache::PutBuffer takes a const char*. We should just fix the IDL.
Keywords: checkin-needed
Attached patch fix warnings, v2 (obsolete) — Splinter Review
Ms2ger, is this what you had in mind?

I can't carryover mwu's r+, so re-r?'ing him.
Attachment #584763 - Attachment is obsolete: true
Attachment #584788 - Flags: review?(mwu)
Attachment #584788 - Flags: review?(Ms2ger)
Comment on attachment 584788 [details] [diff] [review]
fix warnings, v2

Yes, looks good. Thanks.
Attachment #584788 - Flags: review?(Ms2ger) → feedback+
Comment on attachment 584788 [details] [diff] [review]
fix warnings, v2

Even better. Just rev the uuid when you check this in.
Attachment #584788 - Flags: review?(mwu) → review+
Attached patch fix warnings, v3Splinter Review
Rev'ing UUID, carrying over +'s.
Attachment #584788 - Attachment is obsolete: true
Attachment #584845 - Flags: review+
Attachment #584845 - Flags: feedback+
Keywords: checkin-needed
I'll land it tomorrow.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/092e88ea2eb7
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.