]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Squelch a -Wdeclaration-after-statement warning.
authorDenis Ovsienko <[email protected]>
Sat, 21 Jul 2018 21:50:25 +0000 (22:50 +0100)
committerDenis Ovsienko <[email protected]>
Sat, 21 Jul 2018 21:50:53 +0000 (22:50 +0100)
./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

index e6c7bd4a7e9e89671cb80a282b72e5f605d434d5..17e9c7503a3d2042033f6a6ca091c7fe4711340d 100644 (file)
@@ -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