From: Francois-Xavier Le Bail Date: Wed, 23 Jun 2021 11:53:18 +0000 (+0200) Subject: Squelch a narrowing warning X-Git-Tag: libpcap-1.10.2~403 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/0ac001846207133b45e474a2725905b62f0bc086?ds=inline 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); ~ ^~~~~~~~~~ (cherry picked from commit 16782c7e7811c2bc821c1f58ae948af7bccf81fe) --- 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));