exception_handler.cc:535:23: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]

RESOLVED FIXED in Firefox 48

Status

()

Toolkit
Crash Reporting
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
mozilla48
Points:
---

Firefox Tracking Flags

(firefox48 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Build warning on linux debug (with clang 3.8):

{
In file included from Unified_cpp_src_client_linux0.cpp:38:
Warning: -Wwritable-strings in $SRC/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc: ISO C++11 does not allow conversion from string literal to 'char *'
$SRC/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc:535:23: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
    char *clonedMsg = "ExceptionHandler::GenerateDump cloned child ";
                      ^
Warning: -Wwritable-strings in $SRC/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc: ISO C++11 does not allow conversion from string literal to 'char *'
$SRC/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc:545:22: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
    char *childMsg = "ExceptionHandler::GenerateDump I'm the child\n";
                     ^
}


These string literals (which we added in bug 1247399) need to be declared as const to make the warning go away.

But really, they probably want to be...
  static const char variableName[] = "whatever";
...for consistency with the rest of the file.
(Assignee)

Comment 1

2 years ago
Created attachment 8732710 [details]
MozReview Request: Bug 1258269: Declare logging string-literals in exception_handler.cc as 'const char[]' to fix build warning & for consistency. r?ted

Review commit: https://reviewboard.mozilla.org/r/41269/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/41269/
Attachment #8732710 - Flags: review?(ted)
Comment on attachment 8732710 [details]
MozReview Request: Bug 1258269: Declare logging string-literals in exception_handler.cc as 'const char[]' to fix build warning & for consistency. r?ted

https://reviewboard.mozilla.org/r/41269/#review37847

These could probably be removed, honestly, since I think snorp figured out the root cause. It doesn't matter much either way.
Attachment #8732710 - Flags: review?(ted) → review+

Comment 4

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/bec154d017a3
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox48: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.