I'm not sure how this could result in a cast error but I do see an error in your code. The first call to strtok initializes the token'izer since you pass it a buffer. The second call, assuming you want it to find the next token, should have a null value instead of the same buffer.
So what you want is:
...
int i=0;
str = strtok(buffer, " ");
do {
argv[i] = str; //**This line causes the warning!
...
} while (str = strtok(NULL, " ") != NULL);