compilation error on NetBSD 11.99.3/gcc 14.3
Thomas Klausner <[email protected]> Tue, 7 Oct 2025 13:19:20 +0200
| Newsgroups | gmane.comp.web.wget.general |
|---|---|
| Message-ID | <j73ga3bnqfttovda42ny2h7c4gdzpszljp6jfzz4wafhxbznej@gkz2ccnl7km6> |
--mvkzsc762hduas2r
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi!
On NetBSD 11.99.3/x86_64 with gcc 14.3.0, wget 1.25.0 fails to build with:
--- libgnu_a-utimens.o ---
utimens.c: In function 'rpl_utimens':
utimens.c:541:10: error: implicit declaration of function 'utimens'; did you mean 'futimens'? [-Wimplicit-function-declaration]
541 | return utimens (file, timespec);
| ^~~~~~~
| futimens
utimens.c: In function 'rpl_lutimens':
utimens.c:563:10: error: implicit declaration of function 'lutimens'; did you mean 'futimens'? [-Wimplicit-function-declaration]
563 | return lutimens (file, timespec);
| ^~~~~~~~
| futimens
*** [libgnu_a-utimens.o] Error code 1
These functions are defined in sys/stat.h, according to the NetBSD man
page. The attached patch fixes it.
(I see that utimens.c already includes sys/stat.h, but that seems to
be too late.)
Thomas
--mvkzsc762hduas2r
Content-Type: text/x-c; charset=us-ascii
Content-Disposition: attachment; filename="patch-lib_utimens.h"
$NetBSD: patch-lib_utimens.h,v 1.1 2025/10/07 11:18:32 wiz Exp $
Add header for utimens().
--- libgnu_a-utimens.o ---
utimens.c: In function 'rpl_utimens':
utimens.c:541:10: error: implicit declaration of function 'utimens'; did you mean 'futimens'? [-Wimplicit-function-declaration]
541 | return utimens (file, timespec);
| ^~~~~~~
| futimens
utimens.c: In function 'rpl_lutimens':
utimens.c:563:10: error: implicit declaration of function 'lutimens'; did you mean 'futimens'? [-Wimplicit-function-declaration]
563 | return lutimens (file, timespec);
| ^~~~~~~~
| futimens
*** [libgnu_a-utimens.o] Error code 1
--- lib/utimens.h.orig 2025-10-07 11:13:03.489558332 +0000
+++ lib/utimens.h
@@ -25,6 +25,7 @@
#include <time.h>
#if HAVE_UTIMENS || HAVE_LUTIMENS
+# include <sys/stat.h>
# include <sys/time.h>
#endif
--mvkzsc762hduas2r--