From: Stanislav K. <sta...@or...> - 2013-08-07 12:36:20
|
On 08/07/2013 04:10 PM, ch...@su... wrote: > Hi! >> void tst_run_cmd_fds(void (cleanup_fn)(void), >> - char *const argv[], >> + const char *const argv[], >> int stdout_fd, >> int stderr_fd); >> >> @@ -236,7 +236,7 @@ void tst_run_cmd_fds(void (cleanup_fn)(void), >> * not needed. >> */ >> void tst_run_cmd(void (cleanup_fn)(void), >> - char *const argv[], >> + const char *const argv[], >> const char *stdout_path, >> const char *stderr_path); > Gosh, that fixed the warning in the test but I've overlooked that > execvp() takes char *const argv[] argument so it introduced warning in > the lib. Now I wonder why execvp() has such strange parameter type... > > I'm trying to figure out how to fix it 'right' but it gets unnecessary > complicated. I guess that we can fix this patch by casting the array in > the lib before it gets to execvp(). I think that casting mod_name to (char *) is easier than casting array before it gets to execvp(). And it doesn't require any changes of tst_run_cmd interfaces (ie they accepts argv the same way as execvp does)... Maybe leave everything as is and just cast mod_name to (char *)? |