Code: Alles auswählen
gcc test.c -std=c99 -L/home/klemens/progc/llib -L/lib -I/usr/include -I/usr/include/mysql -I/home/klemens/progc/include -lncurses -lown -lm -g -o test
test.c: In function 'main':
test.c:62:17: warning: implicit declaration of function 'fdopen'; did you mean 'fopen'? [-Wimplicit-function-declaration]
62 | if((outfile = fdopen(fd[1], "w")) == NULL)
| ^~~~~~
| fopen
test.c:62:15: warning: assignment to 'FILE *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
62 | if((outfile = fdopen(fd[1], "w")) == NULL)
| ^i
Um das Problem zu umgehen habe ich eine Loesung mit popen versucht
(wie TLPI S.902ff), die ebenfalls Warnngen verursacht:
Code: Alles auswählen
gcc test.c -std=c99 -L/home/klemens/progc/llib -L/lib -I/usr/include -I/usr/include/mysql -I/home/klemens/progc/include -lncurses -lown -lm -g -o test
test.c: In function 'main':
test.c:25:12: warning: implicit declaration of function 'popen'; did you mean 'fopen'? [-Wimplicit-function-declaration]
25 | outfile = popen (pcmd, "w");
| ^~~~~
| fopen
test.c:25:10: warning: assignment to 'FILE *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
25 | outfile = popen (pcmd, "w");
| ^
Was mache ich hier falsch? vielen Dank fuer Hinweise im voraus.
kginbg.