The default bug view has changed. See this FAQ.

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

RESOLVED FIXED in mozilla12

Status

()

Core
XPCOM
RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: dholbert, Assigned: froydnj)

Tracking

(Blocks: 1 bug)

Trunk
mozilla12
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning])

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

7 years ago
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: 187528
(Reporter)

Updated

5 years ago
Blocks: 520309
(Assignee)

Comment 1

5 years ago
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...
Assignee: nobody → nfroyd
Status: NEW → ASSIGNED
Attachment #584763 - Flags: review?(mwu)
(Assignee)

Updated

5 years ago
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*'

Updated

5 years ago
Attachment #584763 - Flags: review?(mwu) → review+
(Assignee)

Updated

5 years ago
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
(Assignee)

Comment 3

5 years ago
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.
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 5

5 years ago
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+
(Assignee)

Comment 6

5 years ago
Created attachment 584845 [details] [diff] [review]
fix warnings, v3

Rev'ing UUID, carrying over +'s.
Attachment #584788 - Attachment is obsolete: true
Attachment #584845 - Flags: review+
Attachment #584845 - Flags: feedback+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
I'll land it tomorrow.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/092e88ea2eb7
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla12
You need to log in before you can comment on or make changes to this bug.