Building code that includes libnfs.h can trigger a build error... Simple test case: % cat test-libnfs.h.c #include <nfsc/libnfs.h> % cc -I/usr/local/include -c -o /dev/null test-libnfs.h.c In file included from test-libnfs.h.c:1: /usr/local/include/nfsc/libnfs.h:1216:23: error: field has incomplete type 'struct timeval' struct timeval atime; ^ /usr/local/include/nfsc/libnfs.h:1216:15: note: forward declaration of 'struct timeval' struct timeval atime; ^ /usr/local/include/nfsc/libnfs.h:1217:23: error: field has incomplete type 'struct timeval' struct timeval mtime; ^ /usr/local/include/nfsc/libnfs.h:1216:15: note: forward declaration of 'struct timeval' struct timeval atime; ^ /usr/local/include/nfsc/libnfs.h:1218:23: error: field has incomplete type 'struct timeval' struct timeval ctime; ^ /usr/local/include/nfsc/libnfs.h:1216:15: note: forward declaration of 'struct timeval' struct timeval atime; ^ 3 errors generated.
See also bug 258349 for a real world example.
Created attachment 227772 [details] [patch] include sys/time.h instead of time.h in libnfs.h Include sys/time.h instead of time.h in libnfs.h Can be submitted upstream. Better might be for libnfs to detect the right time.h to include based on a 'configure' test rather than hard-coding OS dependent ifdefs.
(In reply to John Hein from comment #2) Patch was QA tested with: - poudriere testport (11-stable, 12-stable) - ok - portlint (no new errors or warnings, but there are existing portlint errors [1] that could be fixed in addition to this patch) [1] % portlint FATAL: Makefile: DISTVERSIONPREFIX appears out-of-order. FATAL: Makefile: order must be PORTNAME/PORTVERSION/DISTVERSIONPREFIX/DISTVERSION/DISTVERSIONSUFFIX/PORTREVISION/PORTEPOCH/CATEGORIES/MASTER_SITES/MASTER_SITE_SUBDIR/PROJECTHOST/PKGNAMEPREFIX/PKGNAMESUFFIX/DISTNAME/EXTRACT_SUFX/DISTFILES(_\w+)?/DIST_SUBDIR/EXTRACT_ONLY. WARN: Makefile: "USES" has to appear earlier. 2 fatal errors and 1 warning found.
Upstream bug also filed: https://github.com/sahlberg/libnfs/issues/358
Created attachment 233249 [details] Update to 5.0.1 With sys/time.h fixed and order in Makefile. P.S. Is it maintainer timeout?
Fix committed, don't forget to send PR to upstream, it seems it's not done yet.
(In reply to Kirill Ponomarev from comment #6) > Fix committed, Thanks! > don't forget to send PR to upstream, it seems it's not done yet. Already yesterday: https://github.com/sahlberg/libnfs/issues/358#issuecomment-1100646146
Commited in upstream: https://github.com/sahlberg/libnfs/commit/cc916b8b9f389d45063cd280f52bd202b4a847c8 Waiting new release.