prog.c: In function ‘copypaste’:
prog.c:33:24: warning: passing argument 2 of ‘fopen’ makes pointer from integer without a cast [-Wint-conversion]
if((f=fopen(fileName,'r'))== NULL) {
^~~
In file included from prog.c:1:0:
/usr/include/stdio.h:274:14: note: expected ‘const char * restrict’ but argument is of type ‘int’
extern FILE *fopen (const char *__restrict __filename,
^~~~~
prog.c:38:15: warning: passing argument 1 of ‘fgets’ from incompatible pointer type [-Wincompatible-pointer-types]
while (fgets(f, buf, BUF_SIZE)!=NULL) {
^
In file included from prog.c:1:0:
/usr/include/stdio.h:624:14: note: expected ‘char * restrict’ but argument is of type ‘FILE * {aka struct _IO_FILE *}’
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
^~~~~
prog.c:38:18: warning: passing argument 2 of ‘fgets’ makes integer from pointer without a cast [-Wint-conversion]
while (fgets(f, buf, BUF_SIZE)!=NULL) {
^~~
In file included from prog.c:1:0:
/usr/include/stdio.h:624:14: note: expected ‘int’ but argument is of type ‘char *’
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
^~~~~
prog.c:5:18: warning: passing argument 3 of ‘fgets’ makes pointer from integer without a cast [-Wint-conversion]
#define BUF_SIZE 1024
^
prog.c:38:23: note: in expansion of macro ‘BUF_SIZE’
while (fgets(f, buf, BUF_SIZE)!=NULL) {
^~~~~~~~
In file included from prog.c:1:0:
/usr/include/stdio.h:624:14: note: expected ‘FILE * restrict {aka struct _IO_FILE * restrict}’ but argument is of type ‘int’
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
^~~~~
prog.c:40:13: warning: passing argument 1 of ‘fputs’ from incompatible pointer type [-Wincompatible-pointer-types]
if (fputs(stdout,optBuf) == EOF) {
^~~~~~
In file included from prog.c:1:0:
/usr/include/stdio.h:691:12: note: expected ‘const char * restrict’ but argument is of type ‘struct _IO_FILE *’
extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
^~~~~
prog.c:40:20: warning: passing argument 2 of ‘fputs’ from incompatible pointer type [-Wincompatible-pointer-types]
if (fputs(stdout,optBuf) == EOF) {
^~~~~~
In file included from prog.c:1:0:
/usr/include/stdio.h:691:12: note: expected ‘FILE * restrict {aka struct _IO_FILE * restrict}’ but argument is of type ‘char *’
extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
^~~~~
prog.c:49:13: warning: passing argument 1 of ‘close’ makes integer from pointer without a cast [-Wint-conversion]
if (close(f) == -1)
^
In file included from prog.c:4:0:
/usr/include/unistd.h:356:12: note: expected ‘int’ but argument is of type ‘FILE * {aka struct _IO_FILE *}’
extern int close (int __fd);
^~~~~
prog.c: In function ‘main’:
prog.c:65:17: warning: implicit declaration of function ‘getopt’ [-Wimplicit-function-declaration]
while ((opt = getopt(argc,argv,"bn"))!=-1) {
^~~~~~
prog.c:72:5: error: ‘optind’ undeclared (first use in this function)
if(optind > argc) {
^~~~~~
prog.c:72:5: note: each undeclared identifier is reported only once for each function it appears in