]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Include <time.h> from netdissect.h.
authorDenis Ovsienko <[email protected]>
Wed, 15 Feb 2023 09:20:02 +0000 (09:20 +0000)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 11 Oct 2023 19:04:42 +0000 (21:04 +0200)
netdissect.h since commit 7578e1c requires <time.h> for struct tm.  The
dependency is difficult to notice because the warning pops up when
compiling strdup.c only and only on Linux, and Linux most certainly has
strdup(), so normally strdup.c is never compiled on Linux.  Make it
correct anyway to eliminate a space for future surprises in other files.

$ make strdup.o
In file included from ./missing/strdup.c:38:
./netdissect.h:441:38: warning: 'struct tm' declared inside parameter
  list will not be visible outside of this definition or declaration

gcc (Debian 10.2.1-6) 10.2.1 20210110

(backported from commit 695ce83d0ad8eeaec1e1dec218279ac2d2168189)

netdissect.h
print-ntp.c

index 077ae3968b1af88dae8fe1ed3cf212cd5e9c12e5..9dc70db0a0fd02d15da535aad0651b566905e03b 100644 (file)
@@ -30,6 +30,7 @@
 #endif
 #include <sys/types.h>
 #include <setjmp.h>
+#include <time.h>
 #include "status-exit-codes.h"
 #include "funcattrs.h" /* for PRINTFLIKE_FUNCPTR() */
 #include "diag-control.h" /* for ND_UNREACHABLE */
index 537975cc2e593b798b72d5985c58bbf4c1ee0b63..92e3e297124031320be00015707119533a7a6fa1 100644 (file)
@@ -38,8 +38,6 @@
 
 #include "netdissect-stdinc.h"
 
-#include <time.h>
-
 #include "netdissect.h"
 #include "addrtoname.h"
 #include "extract.h"