Missing time.h header declaration results in compile-time warnings
xandark opened this issue · 1 comments
xandark commented
I got three warnings when running make under a fresh Raspbian Stretch install, which complained about a missing declaration for one function: nanosleep().
These were solved by inserting:
#include <time.h>
into a2joy.c, a2joymou.c, and a2joypad.c.
Then making resulted in a clean, warning-less build and gave me a little more confidence that everything was okay :)
pi@clearpi ~/apple2pi> make
make -C src
make[1]: Entering directory '/home/pi/apple2pi/src'
cc a2joy.c -o a2joy
a2joy.c: In function ‘main’:
a2joy.c:179:2: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration]
nanosleep(&tv, NULL);
^~~~~~~~~
cc a2joymou.c -o a2joymou
a2joymou.c: In function ‘main’:
a2joymou.c:194:2: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration]
nanosleep(&tv, NULL);
^~~~~~~~~
cc a2joypad.c -o a2joypad
a2joypad.c: In function ‘main’:
a2joypad.c:206:2: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration]
nanosleep(&tv, NULL);
^~~~~~~~~
cc a2mon.c -o a2mon
cc a2term.c -o a2term
cc -I/usr/include/fuse -D_FILE_OFFSET_BITS=64 fusea2pi.c -lfuse -o fusea2pi
cc a2pidcmd.c -o a2pidcmd
cc dskread.c -o dskread
cc dskwrite.c -o dskwrite
cc bload.c -o bload
cc brun.c -o brun
cc -DSETSERCLK a2pid.c -o a2pid
make[1]: Leaving directory '/home/pi/apple2pi/src'
dschmenk commented
Thanks!