]> The Tcpdump Group git mirrors - libpcap/commitdiff
Address/note warnings from Clang 3.4 on Ubuntu 14.04.6. 1455/head
authorDenis Ovsienko <[email protected]>
Tue, 4 Feb 2025 00:47:02 +0000 (00:47 +0000)
committerDenis Ovsienko <[email protected]>
Tue, 4 Feb 2025 13:47:40 +0000 (13:47 +0000)
pcap-linux.c:3570:3: error: will never be executed
  [-Werror,-Wunreachable-code]
pcap-linux.c:3566:3: error: will never be executed
  [-Werror,-Wunreachable-code]

build.sh
pcap-linux.c

index f029b42b78f545647ad04784dd595409f55f9080..0983a4ab5baf088a3292ade2efcd838513dc079c 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -34,6 +34,15 @@ tcc-*/*)
     # thread-local storage.
     LIBPCAP_TAINTED=yes
     ;;
+clang-3.4/Linux-*)
+    # pcap-netfilter-linux.c:427:10: error: will never be executed
+    #   [-Werror,-Wunreachable-code]
+    # pcap.c:3812:4: error: will never be executed
+    #   [-Werror,-Wunreachable-code]
+    # scanner.l:662:3: warning: will never be executed [-Wunreachable-code]
+    # gencode.c:7061:3: warning: will never be executed [-Wunreachable-code]
+    LIBPCAP_TAINTED=yes
+    ;;
 *)
     ;;
 esac
index fbd474b4923b03bd6531e5b3eefac9b6cb342146..ef3f551f2ec7817ee882cfca383653550cac89f0 100644 (file)
@@ -3563,11 +3563,9 @@ pcap_get_ring_frame_status(pcap_t *handle, u_int offset)
        switch (handlep->tp_version) {
        case TPACKET_V2:
                return __atomic_load_n(&h.h2->tp_status, __ATOMIC_ACQUIRE);
-               break;
 #ifdef HAVE_TPACKET3
        case TPACKET_V3:
                return __atomic_load_n(&h.h3->hdr.bh1.block_status, __ATOMIC_ACQUIRE);
-               break;
 #endif
        }
        /* This should not happen. */