Avoid a warning about converting a string literal to (non-const) char *
authorMikko Rasa <tdb@tdb.fi>
Wed, 2 Nov 2011 10:51:48 +0000 (12:51 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 2 Nov 2011 10:51:48 +0000 (12:51 +0200)
src/archutils/Unix/CrashHandler.cpp

index fd200ad..a387995 100755 (executable)
@@ -102,9 +102,10 @@ static void NORETURN spawn_child_process( int from_parent )
        GetExecutableName( path, sizeof(path) );
 
        /* Use execve; it's the lowest-level of the exec calls.  The others may allocate. */
-       char *argv[3] = { path, CHILD_MAGIC_PARAMETER, NULL };
+       const char *argv[3] = { path, CHILD_MAGIC_PARAMETER, NULL };
        char *envp[1] = { NULL };
-       execve( path, argv, envp );
+       /* The const_cast won't matter since our address space gets destroyed in a moment anyway */
+       execve( path, const_cast<char **>(argv), envp );
 
        /* If we got here, the exec failed.  We can't call strerror. */
        // safe_print(fileno(stderr), "Crash handler execl(", path, ") failed: ", strerror(errno), "\n", NULL);