prevents duplicate getopt declaration since unistd.h includes the system
getopt_posix.h but due to -I. the "local" getopt.h redeclares getopt
gcc -DLinux -Di386 -O2 -DHV -Wall -I. -DTAP -c hv.c
In file included from hv.c:45:
./getopt.h:53:5: error: conflicting types for ‘getopt’
int getopt(int argc, char* argv, char optstr);
^~
In file included from /usr/include/x86_64-linux-gnu/bits/getopt_posix.h:27,
from /usr/include/unistd.h:869,
from hv.c:33:
/usr/include/x86_64-linux-gnu/bits/getopt_core.h:91:12: note: previous declaration of ‘getopt’ was here
extern int getopt (int argc, char const argv, const char *__shortopts)
^~
make: *** [Makefile.linux:37: hv.o] Error 1
prevents duplicate getopt declaration since unistd.h includes the system getopt_posix.h but due to -I. the "local" getopt.h redeclares getopt
gcc -DLinux -Di386 -O2 -DHV -Wall -I. -DTAP -c hv.c In file included from hv.c:45: ./getopt.h:53:5: error: conflicting types for ‘getopt’ int getopt(int argc, char* argv, char optstr); ^
~In file included from /usr/include/x86_64-linux-gnu/bits/getopt_posix.h:27, from /usr/include/unistd.h:869, from hv.c:33: /usr/include/x86_64-linux-gnu/bits/getopt_core.h:91:12: note: previous declaration of ‘getopt’ was here extern int getopt (int argc, char const argv, const char *__shortopts) ^~make: *** [Makefile.linux:37: hv.o] Error 1