I want to use the execev function to run the texwork program from a fork of another program, and therefore, i have the following setup :
char *argVec[3];
argVec[0] = "texworks";
argVec[1] = "temp.tex";
argVec[2] = NULL;
execvp("texworks", argVec);
it works, but warns me :
Warnung: veraltete Konvertierung von Zeichenkettenkonstante in »char*« [-Wwrite-strings]
argVec[1] = "temp.tex";
that is : warning, old conversion from string constant to char* (the same warnign for argVec[0])
Should I be worried, and if so, how to i avoid this?
(oh, i am in Linux, 64 bit, g++ 4.8.1 -2013 prerelease, and const char* argVec[] = {"texworks" .. etc failes with this :
Fehler: ungültige Umwandlung von »const char**« in »char* const*« [-fpermissive]
execvp("texworks", argVec);
^
In file included from path/to/file:
/usr/include/unistd.h:578:12: Fehler: Argument 2 von »int execvp(const char*, char* const*)« wird initialisiert [-fpermissive]
extern int execvp (const char *__file, char *const __argv[])
^
/path/to/file:cursor:position: Fehler: Sprung zur case-Marke [-fpermissive]
default:
^
/path/to/file:cursor:position:: Fehler: überschneidet Initialisierung von »const char* argVec [3]«
const char * argVec[] = {"texworks" , "temp.tex", NULL};