From 16782c7e7811c2bc821c1f58ae948af7bccf81fe Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Wed, 23 Jun 2021 13:53:18 +0200 Subject: Squelch a narrowing warning Ignore the warning in the way to enable build with -Werror. To be look at before 2038... The warning was (clang 64 bits): ./pcap-netfilter-linux.c:346:12: warning: implicit conversion loses integer precision: 'time_t' (aka 'long') to 'unsigned int' [-Wshorten-64-to-32] seq_id = time(NULL); ~ ^~~~~~~~~~ --- pcap-netfilter-linux.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pcap-netfilter-linux.c') diff --git a/pcap-netfilter-linux.c b/pcap-netfilter-linux.c index 17f528fc..d9550b02 100644 --- a/pcap-netfilter-linux.c +++ b/pcap-netfilter-linux.c @@ -33,6 +33,7 @@ #endif #include "pcap-int.h" +#include "diag-control.h" #ifdef NEED_STRERROR_H #include "strerror.h" @@ -343,7 +344,9 @@ netfilter_send_config_msg(const pcap_t *handle, uint16_t msg_type, int ack, u_in static unsigned int seq_id; if (!seq_id) +DIAG_OFF_NARROWING seq_id = time(NULL); +DIAG_ON_NARROWING ++seq_id; nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nfgenmsg)); -- cgit v1.2.3