riscv-openocd
riscv-openocd copied to clipboard
compilation error on macOS
I got the same error as #182, but the comments in it did not help.
discovery_tcp.c:305:9: error: implicit declaration of function 'select' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ret = select(sock + 1, &rfds, NULL, NULL, &timeout);
Fresh checkout, branch riscv. Please help, thanks.
Ok, I solved it by adding one line to src/jtag/drivers/libjaylink/libjaylink/discovery_tcp.c
#include <sys/select.h>
Might be useful here too?
https://github.com/riscv/riscv-openocd/issues/423#issuecomment-575409664
got the same problem today. Solved this with the same include independently before seeing this ticket. @timsifive , could you, please, just add this include in the file? Not sure why it compiles on other platforms - the file uses external function without its prototype defined.
Mac uses apple version of clang instead if GCC, which is more stringent than GCC, I guess. My peer installed GCC on his Mac, and could compile the tool without this problem ..
@agrobman Can you submit a PR for this?
I can’t , I have other changes in my files
Alex
@filamoon, @agrobman, I would like to close this one. The fix is present in currently used version of libjaylink
.