Closed Bug 1258269 Opened 8 years ago Closed 8 years ago

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

Categories

(Toolkit :: Crash Reporting, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

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.
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+
https://hg.mozilla.org/mozilla-central/rev/bec154d017a3
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.