Bug 1258269: Declare logging string-literals in exception_handler.cc as 'const char[]' to fix build warning & for consistency. r=ted
authorDaniel Holbert <dholbert@cs.stanford.edu>
Sun, 20 Mar 2016 23:35:13 -0700
changeset 289675 bec154d017a38ac52a3352603822b68ad6b4d05b
parent 289674 4e844efafd5d8ccf1cf1b891503555901185d9d7
child 289676 d988225162ef6805a89741f2844a1d647b441b8f
push id30108
push usercbook@mozilla.com
push dateTue, 22 Mar 2016 11:14:31 +0000
treeherdermozilla-central@ea6298e1b4f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1258269
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1258269: Declare logging string-literals in exception_handler.cc as 'const char[]' to fix build warning & for consistency. r=ted MozReview-Commit-ID: 9UDHiPJus0C
toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
@@ -527,27 +527,29 @@ bool ExceptionHandler::GenerateDump(Cras
       &thread_arg, NULL, NULL, NULL);
   if (child == -1) {
     sys_close(fdes[0]);
     sys_close(fdes[1]);
     return false;
   }
 
   if (child != 0) {
-    char *clonedMsg = "ExceptionHandler::GenerateDump cloned child ";
+    static const char clonedMsg[] =
+      "ExceptionHandler::GenerateDump cloned child ";
     char pidMsg[32];
 
     unsigned int pidLen = my_uint_len(child);
     my_uitos(pidMsg, child, pidLen);
 
     logger::write(clonedMsg, my_strlen(clonedMsg));
     logger::write(pidMsg, pidLen);
     logger::write("\n", 1);
   } else {
-    char *childMsg = "ExceptionHandler::GenerateDump I'm the child\n";
+    static const char childMsg[] =
+      "ExceptionHandler::GenerateDump I'm the child\n";
     logger::write(childMsg, my_strlen(childMsg));
   }
 
   // Allow the child to ptrace us
   sys_prctl(PR_SET_PTRACER, child, 0, 0, 0);
   SendContinueSignalToChild();
   int status;
   const int r = HANDLE_EINTR(sys_waitpid(child, &status, __WALL));