From 19a552ae283d078c7223ceab3d757549d338b437 Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Sat, 21 Jul 2018 22:50:25 +0100 Subject: Squelch a -Wdeclaration-after-statement warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ./print-sll.c: In function ‘sll2_if_print’: ./print-sll.c:419:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] uint32_t index = EXTRACT_BE_U_4(sllp->sll2_if_index); ^~~~~~~~ [skip ci] --- print-sll.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'print-sll.c') diff --git a/print-sll.c b/print-sll.c index e6c7bd4a..17e9c750 100644 --- a/print-sll.c +++ b/print-sll.c @@ -400,6 +400,7 @@ sll2_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char int llc_hdrlen; u_int hdrlen; #ifdef HAVE_NET_IF_H + uint32_t index; char ifname[IF_NAMESIZE]; #endif @@ -416,7 +417,7 @@ sll2_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char sllp = (const struct sll2_header *)p; #ifdef HAVE_NET_IF_H - uint32_t index = EXTRACT_BE_U_4(sllp->sll2_if_index); + index = EXTRACT_BE_U_4(sllp->sll2_if_index); if (if_indextoname(index, ifname)) ND_PRINT("ifindex %u (%s) ", index, ifname); else -- cgit v1.2.1