Fails to build with GCC on CentOS 7
On a fresh clone of the main branch as of today:
```
% make
cc -w -Os -c -o lisp.o lisp.c
cc -w -Os -c -o bestline.o bestline.c
In file included from /usr/include/sys/stat.h:106:0,
from bestline.c:146:
/usr/include/bits/stat.h:91:21: error: field ‘st_atim’ has incomplete type
struct timespec st_atim; /* Time of last access. */
^
/usr/include/bits/stat.h:92:21: error: field ‘st_mtim’ has incomplete type
struct timespec st_mtim; /* Time of last modification. */
^
/usr/include/bits/stat.h:93:21: error: field ‘st_ctim’ has incomplete type
struct timespec st_ctim; /* Time of last status change. */
^
In file included from bestline.c:146:0:
/usr/include/sys/stat.h:373:54: error: array type has incomplete element type
extern int futimens (int __fd, const struct timespec __times[2]) __THROW;
^
make: *** [bestline.o] Error 1
```
I think it can be fixed just by adding `#include <sys/time.h>` before `#include <sys/stat.h>` on `bestline.c`?
关闭于 2023-02-23 5 条评论