While using newer llvm/clang we encountered some compiler errors about implicit function declarations and return type.
setserial.c:639:2: error: call to undeclared function 'close'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declarat
ion]
close(fd);
^
setserial.c:718:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
main(int argc, char **argv)
^
int
setserial.c:728:14: error: call to undeclared function 'getopt'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declar
ation]
while ((c = getopt(argc, argv, "abgGqvVWz")) != EOF) {
^
Attached patch fixes it. Please apply if you find it ok.
While using newer llvm/clang we encountered some compiler errors about implicit function declarations and return type.
setserial.c:639:2: error: call to undeclared function 'close'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declarat
ion]
close(fd);
^
setserial.c:718:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
main(int argc, char **argv)
^
int
setserial.c:728:14: error: call to undeclared function 'getopt'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declar
ation]
while ((c = getopt(argc, argv, "abgGqvVWz")) != EOF) {
^
Attached patch fixes it. Please apply if you find it ok.
Don't you need
#include <stdlib.h>
as well, forexit
?