]> 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)
committerDenis Ovsienko <[email protected]>
Wed, 15 Feb 2023 09:36:39 +0000 (09:36 +0000)
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

netdissect.h
print-ntp.c

index d953a464ea112172acfb5472d8763ed1380f6eec..aa6dfe5b9ea56260d4819a8553b37c1f40474405 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 499585fd1dfe44bd6c92b48954a45796a8181dce..f4ea80f611ae9d91cc24842c28e2d4d21cb6b670 100644 (file)
@@ -38,8 +38,6 @@
 
 #include "netdissect-stdinc.h"
 
-#include <time.h>
-
 #define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 #include "addrtoname.h"