sahlberg / libnfs

NFS client library
Other
510 stars 200 forks source link

utils/nfs-stat.c: include time.h #478

Closed ffontaine closed 1 month ago

ffontaine commented 1 month ago

Include time.h to fix the following build failure with gcc >= 14 which enables -Werror=implicit-function-declaration (https://gcc.gnu.org/gcc-14/porting_to.html):

nfs-stat.c: In function 'main':
nfs-stat.c:287:30: error: implicit declaration of function 'ctime' [-Wimplicit-function-declaration]
  287 |         printf("Access: %s", ctime( (const time_t *) &st.nfs_atime));
      |                              ^~~~~
nfs-stat.c:177:1: note: 'ctime' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
  176 | #include <pwd.h>
  +++ |+#include <time.h>
  177 | char *uid_to_name(int uid)

Fixes:

sahlberg commented 1 month ago

Merged, thanks!