diff options
| author | Dan Gohman <gohman@apple.com> | 2010-04-19 15:55:10 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-04-19 15:55:10 +0000 |
| commit | f656397cc029d6d58957dcb86e48eef4e77043b7 (patch) | |
| tree | efc09fe673899625e7a245ad8cf734d9e2ba6e42 /llvm/lib/System/Unix | |
| parent | a84dc0cc6eea37169f7cc1c0541a487c3f35921c (diff) | |
| download | bcm5719-llvm-f656397cc029d6d58957dcb86e48eef4e77043b7.tar.gz bcm5719-llvm-f656397cc029d6d58957dcb86e48eef4e77043b7.zip | |
Fix -Wcast-qual warnings.
llvm-svn: 101782
Diffstat (limited to 'llvm/lib/System/Unix')
| -rw-r--r-- | llvm/lib/System/Unix/Program.inc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc index 47afe52f51d..358415f5266 100644 --- a/llvm/lib/System/Unix/Program.inc +++ b/llvm/lib/System/Unix/Program.inc @@ -206,14 +206,15 @@ Program::Execute(const Path &path, const char **args, const char **envp, if (!envp) #if !defined(__APPLE__) - envp = (const char**)environ; + envp = const_cast<const char **>(environ); #else - envp = (const char**)*_NSGetEnviron(); // environ is missing in dylibs. + // environ is missing in dylibs. + envp = const_cast<const char **>(*_NSGetEnviron()); #endif pid_t PID; - int Err = posix_spawn(&PID, path.c_str(), &FileActions, - /*attrp*/0, (char**)args, (char**)envp); + int Err = posix_spawn(&PID, path.c_str(), &FileActions, /*attrp*/0, + const_cast<char **>(args), const_cast<char **>(envp)); posix_spawn_file_actions_destroy(&FileActions); @@ -268,9 +269,12 @@ Program::Execute(const Path &path, const char **args, const char **envp, // Execute! if (envp != 0) - execve(path.c_str(), (char**)args, (char**)envp); + execve(path.c_str(), + const_cast<char **>(args), + const_cast<char **>(envp)); else - execv(path.c_str(), (char**)args); + execv(path.c_str(), + const_cast<char **>(args)); // If the execve() failed, we should exit. Follow Unix protocol and // return 127 if the executable was not found, and 126 otherwise. // Use _exit rather than exit so that atexit functions and static |

